Restrictions on decoder side motion vector derivation based on coding information

ABSTRACT

Devices, systems and methods for digital video coding, which includes restrictions on decoder-side motion vector derivation based on coding information, are described. An exemplary method for video processing includes making a decision, for a conversion between a current block of a video and a bitstream representation of the video, regarding a selective enablement of a decoder side motion vector derivation (DMVD) tool for the current block, the DMVD tool deriving a refinement of motion information signaled in the bitstream representation, and the conversion using a merge mode and motion vector differences that are indicated by a motion direction and a motion magnitude, and performing, based on the decision, a conversion between the current block and the bitstream representation.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of International Application No.PCT/IB2019/058976, filed on Oct. 22, 2019, which claims the priority toand benefits of International Patent Application No. PCT/CN2018/111224,filed on Oct. 22, 2018, and PCT/CN2018/123407, filed on Dec. 25, 2018.All the aforementioned patent applications are hereby incorporated byreference in their entireties.

TECHNICAL FIELD

This patent document relates to video coding techniques, devices andsystems.

BACKGROUND

In spite of the advances in video compression, digital video stillaccounts for the largest bandwidth use on the internet and other digitalcommunication networks. As the number of connected user devices capableof receiving and displaying video increases, it is expected that thebandwidth demand for digital video usage will continue to grow.

SUMMARY

Devices, systems and methods related to digital video coding, andspecifically, to restrictions on decoder-side motion vector derivationbased on coding information are described. The described methods may beapplied to both the existing video coding standards (e.g., HighEfficiency Video Coding (HEVC)) and future video coding standards orvideo codecs.

In one representative aspect, the disclosed technology may be used toprovide a method for video processing. This method includes making adecision, for a conversion between a current block of a video and abitstream representation of the video, regarding a selective enablementof a decoder side motion vector derivation (DMVD) tool for the currentblock, wherein the DMVD tool derives a refinement of motion informationsignaled in the bitstream representation, and wherein the conversionuses a merge mode and motion vector differences that are indicated by amotion direction and a motion magnitude; and performing, based on thedecision, a conversion between the current block and the bitstreamrepresentation.

In another representative aspect, the disclosed technology may be usedto provide a method for video processing. This method includes making adecision, based on decoded motion information associated with a currentblock of a video, regarding a selective enablement of a decoder sidemotion vector derivation (DMVD) tool for the current block, wherein theDMVD tool derives a refinement of motion information signaled in abitstream representation of the video; and performing, based on thedecision, a conversion between the current block and the bitstreamrepresentation.

In yet another representative aspect, the above-described method isembodied in the form of processor-executable code and stored in acomputer-readable program medium.

In yet another representative aspect, a device that is configured oroperable to perform the above-described method is disclosed. The devicemay include a processor that is programmed to implement this method.

In yet another representative aspect, a video decoder apparatus mayimplement a method as described herein.

The above and other aspects and features of the disclosed technology aredescribed in greater detail in the drawings, the description and theclaims.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows an example of constructing a merge candidate list.

FIG. 2 shows an example of positions of spatial candidates.

FIG. 3 shows an example of candidate pairs subject to a redundancy checkof spatial merge candidates.

FIGS. 4A and 4B show examples of the position of a second predictionunit (PU) based on the size and shape of the current block.

FIG. 5 shows an example of motion vector scaling for temporal mergecandidates.

FIG. 6 shows an example of candidate positions for temporal mergecandidates.

FIG. 7 shows an example of generating a combined bi-predictive mergecandidate.

FIG. 8 shows an example of constructing motion vector predictioncandidates.

FIG. 9 shows an example of motion vector scaling for spatial motionvector candidates.

FIG. 10 shows an example of motion prediction using the alternativetemporal motion vector prediction (ATMVP) algorithm for a coding unit(CU).

FIG. 11 shows an example of a coding unit (CU) with sub-blocks andneighboring blocks used by the spatial-temporal motion vector prediction(STMVP) algorithm.

FIGS. 12A and 12B show example snapshots of sub-block when using theoverlapped block motion compensation (OBMC) algorithm.

FIG. 13 shows an example of neighboring samples used to deriveparameters for the local illumination compensation (LIC) algorithm.

FIG. 14 shows an example of a simplified affine motion model.

FIG. 15 shows an example of an affine motion vector field (MVF) persub-block.

FIG. 16 shows an example of motion vector prediction (MVP) for theAF_INTER affine motion mode.

FIGS. 17A and 17B show example candidates for the AF_MERGE affine motionmode.

FIG. 18 shows an example of bilateral matching in pattern matched motionvector derivation (PMMVD) mode, which is a special merge mode based onthe frame-rate up conversion (FRUC) algorithm.

FIG. 19 shows an example of template matching in the FRUC algorithm.

FIG. 20 shows an example of unilateral motion estimation in the FRUCalgorithm.

FIG. 21 shows an example of an ultimate motion vector expression (UMVE)search process for a current frame.

FIGS. 22A and 22B show examples of UMVE search points.

FIG. 23 shows an exemplary mapping between distance index and distanceoffset.

FIG. 24 shows an example of an optical flow trajectory used by thebi-directional optical flow (BIO) algorithm.

FIGS. 25A and 25B show example snapshots of using of the bi-directionaloptical flow (BIO) algorithm without block extensions.

FIG. 26 shows an example of the decoder-side motion vector refinement(DMVR) algorithm based on bilateral template matching.

FIGS. 27A and 27B show flowcharts of example methods for videoprocessing.

FIG. 28 is a block diagram of an example of a hardware platform forimplementing a visual media decoding or a visual media encodingtechnique described in the present document.

FIG. 29 is a block diagram of an example video processing system inwhich disclosed techniques may be implemented.

DETAILED DESCRIPTION

Due to the increasing demand of higher resolution video, video codingmethods and techniques are ubiquitous in modern technology. Video codecstypically include an electronic circuit or software that compresses ordecompresses digital video, and are continually being improved toprovide higher coding efficiency. A video codec converts uncompressedvideo to a compressed format or vice versa. There are complexrelationships between the video quality, the amount of data used torepresent the video (determined by the bit rate), the complexity of theencoding and decoding algorithms, sensitivity to data losses and errors,ease of editing, random access, and end-to-end delay (latency). Thecompressed format usually conforms to a standard video compressionspecification, e.g., the High Efficiency Video Coding (HEVC) standard(also known as H.265 or MPEG-H Part 2), the Versatile Video Codingstandard to be finalized, or other current and/or future video codingstandards.

Embodiments of the disclosed technology may be applied to existing videocoding standards (e.g., HEVC, H.265) and future standards to improvecompression performance. Section headings are used in the presentdocument to improve readability of the description and do not in any waylimit the discussion or the embodiments (and/or implementations) to therespective sections only.

1. Examples of Inter-Prediction in HEVC/H.265

Video coding standards have significantly improved over the years, andnow provide, in part, high coding efficiency and support for higherresolutions. Recent standards such as HEVC and H.265 are based on thehybrid video coding structure wherein temporal prediction plus transformcoding are utilized.

1.1 Examples of Prediction Modes

Each inter-predicted PU (prediction unit) has motion parameters for oneor two reference picture lists. In some embodiments, motion parametersinclude a motion vector and a reference picture index. In otherembodiments, the usage of one of the two reference picture lists mayalso be signaled using inter_pred_idc. In yet other embodiments, motionvectors may be explicitly coded as deltas relative to predictors.

When a CU is coded with skip mode, one PU is associated with the CU, andthere are no significant residual coefficients, no coded motion vectordelta or reference picture index. A merge mode is specified whereby themotion parameters for the current PU are obtained from neighboring PUs,including spatial and temporal candidates. The merge mode can be appliedto any inter-predicted PU, not only for skip mode. The alternative tomerge mode is the explicit transmission of motion parameters, wheremotion vector, corresponding reference picture index for each referencepicture list and reference picture list usage are signaled explicitlyper each PU.

When signaling indicates that one of the two reference picture lists isto be used, the PU is produced from one block of samples. This isreferred to as ‘uni-prediction’. Uni-prediction is available both forP-slices and B-slices.

When signaling indicates that both of the reference picture lists are tobe used, the PU is produced from two blocks of samples. This is referredto as ‘bi-prediction’. Bi-prediction is available for B-slices only.

1.1.1 Embodiments of Constructing Candidates for Merge Mode

When a PU is predicted using merge mode, an index pointing to an entryin the merge candidates list is parsed from the bitstream and used toretrieve the motion information. The construction of this list can besummarized according to the following sequence of steps:

Step 1: Initial candidates derivation

-   -   Step 1.1: Spatial candidates derivation    -   Step 1.2: Redundancy check for spatial candidates    -   Step 1.3: Temporal candidates derivation

Step 2: Additional candidates insertion

-   -   Step 2.1: Creation of bi-predictive candidates    -   Step 2.2: Insertion of zero motion candidates

FIG. 1 shows an example of constructing a merge candidate list based onthe sequence of steps summarized above. For spatial merge candidatederivation, a maximum of four merge candidates are selected amongcandidates that are located in five different positions. For temporalmerge candidate derivation, a maximum of one merge candidate is selectedamong two candidates. Since constant number of candidates for each PU isassumed at decoder, additional candidates are generated when the numberof candidates does not reach to maximum number of merge candidate(MaxNumMergeCand) which is signalled in slice header. Since the numberof candidates is constant, index of best merge candidate is encodedusing truncated unary binarization (TU). If the size of CU is equal to8, all the PUs of the current CU share a single merge candidate list,which is identical to the merge candidate list of the 2N×2N predictionunit.

1.1.2 Constructing Spatial Merge Candidates

In the derivation of spatial merge candidates, a maximum of four mergecandidates are selected among candidates located in the positionsdepicted in FIG. 2. The order of derivation is A₁, B₁, B₀, A₀ and B₂.Position B₂ is considered only when any PU of position A₁, B₁, B₀, A₀ isnot available (e.g. because it belongs to another slice or tile) or isintra coded. After candidate at position A₁ is added, the addition ofthe remaining candidates is subject to a redundancy check which ensuresthat candidates with same motion information are excluded from the listso that coding efficiency is improved.

To reduce computational complexity, not all possible candidate pairs areconsidered in the mentioned redundancy check. Instead only the pairslinked with an arrow in FIG. 3 are considered and a candidate is onlyadded to the list if the corresponding candidate used for redundancycheck has not the same motion information. Another source of duplicatemotion information is the “second PU” associated with partitionsdifferent from 2N×2N. As an example, FIGS. 4A and 4B depict the secondPU for the case of N×2N and 2N×N, respectively. When the current PU ispartitioned as N×2N, candidate at position A₁ is not considered for listconstruction. In some embodiments, adding this candidate may lead to twoprediction units having the same motion information, which is redundantto just have one PU in a coding unit. Similarly, position B₁ is notconsidered when the current PU is partitioned as 2N×N.

1.1.3 Constructing Temporal Merge Candidates

In this step, only one candidate is added to the list. Particularly, inthe derivation of this temporal merge candidate, a scaled motion vectoris derived based on co-located PU belonging to the picture which has thesmallest POC difference with current picture within the given referencepicture list. The reference picture list to be used for derivation ofthe co-located PU is explicitly signaled in the slice header.

FIG. 5 shows an example of the derivation of the scaled motion vectorfor a temporal merge candidate (as the dotted line), which is scaledfrom the motion vector of the co-located PU using the POC distances, tband td, where tb is defined to be the POC difference between thereference picture of the current picture and the current picture and tdis defined to be the POC difference between the reference picture of theco-located picture and the co-located picture. The reference pictureindex of temporal merge candidate is set equal to zero. For a B-slice,two motion vectors, one is for reference picture list 0 and the other isfor reference picture list 1, are obtained and combined to make thebi-predictive merge candidate.

In the co-located PU (Y) belonging to the reference frame, the positionfor the temporal candidate is selected between candidates C₀ and C₁, asdepicted in FIG. 6. If PU at position C₀ is not available, is intracoded, or is outside of the current CTU, position C₁ is used. Otherwise,position C₀ is used in the derivation of the temporal merge candidate.

1.1.4 Constructing Additional Types of Merge Candidates

Besides spatio-temporal merge candidates, there are two additional typesof merge candidates: combined bi-predictive merge candidate and zeromerge candidate. Combined bi-predictive merge candidates are generatedby utilizing spatio-temporal merge candidates. Combined bi-predictivemerge candidate is used for B-Slice only. The combined bi-predictivecandidates are generated by combining the first reference picture listmotion parameters of an initial candidate with the second referencepicture list motion parameters of another. If these two tuples providedifferent motion hypotheses, they will form a new bi-predictivecandidate.

FIG. 7 shows an example of this process, wherein two candidates in theoriginal list (710, on the left), which have mvL0 and refIdxL0 or mvL1and refIdxL1, are used to create a combined bi-predictive mergecandidate added to the final list (720, on the right).

Zero motion candidates are inserted to fill the remaining entries in themerge candidates list and therefore hit the MaxNumMergeCand capacity.These candidates have zero spatial displacement and a reference pictureindex which starts from zero and increases every time a new zero motioncandidate is added to the list. The number of reference frames used bythese candidates is one and two for uni- and bi-directional prediction,respectively. In some embodiments, no redundancy check is performed onthese candidates.

1.1.5 Examples of Motion Estimation Regions for Parallel Processing

To speed up the encoding process, motion estimation can be performed inparallel whereby the motion vectors for all prediction units inside agiven region are derived simultaneously. The derivation of mergecandidates from spatial neighborhood may interfere with parallelprocessing as one prediction unit cannot derive the motion parametersfrom an adjacent PU until its associated motion estimation is completed.To mitigate the trade-off between coding efficiency and processinglatency, a motion estimation region (MER) may be defined. The size ofthe MER may be signaled in the picture parameter set (PPS) using the“log 2_parallel_merge_level_minus2” syntax element. When a MER isdefined, merge candidates falling in the same region are marked asunavailable and therefore not considered in the list construction.

1.2 Embodiments of Advanced Motion Vector Prediction (AMVP)

AMVP exploits spatio-temporal correlation of motion vector withneighboring PUs, which is used for explicit transmission of motionparameters. It constructs a motion vector candidate list by firstlychecking availability of left, above temporally neighboring PUpositions, removing redundant candidates and adding zero vector to makethe candidate list to be constant length. Then, the encoder can selectthe best predictor from the candidate list and transmit thecorresponding index indicating the chosen candidate. Similarly withmerge index signaling, the index of the best motion vector candidate isencoded using truncated unary. The maximum value to be encoded in thiscase is 2 (see FIG. 8). In the following sections, details aboutderivation process of motion vector prediction candidate are provided.

1.2.1 Examples of Constructing Motion Vector Prediction Candidates

FIG. 8 summarizes derivation process for motion vector predictioncandidate, and may be implemented for each reference picture list withrefidx as an input.

In motion vector prediction, two types of motion vector candidates areconsidered: spatial motion vector candidate and temporal motion vectorcandidate. For spatial motion vector candidate derivation, two motionvector candidates are eventually derived based on motion vectors of eachPU located in five different positions as previously shown in FIG. 2.

For temporal motion vector candidate derivation, one motion vectorcandidate is selected from two candidates, which are derived based ontwo different co-located positions. After the first list ofspatio-temporal candidates is made, duplicated motion vector candidatesin the list are removed. If the number of potential candidates is largerthan two, motion vector candidates whose reference picture index withinthe associated reference picture list is larger than 1 are removed fromthe list. If the number of spatio-temporal motion vector candidates issmaller than two, additional zero motion vector candidates is added tothe list.

1.2.2 Constructing Spatial Motion Vector Candidates

In the derivation of spatial motion vector candidates, a maximum of twocandidates are considered among five potential candidates, which arederived from PUs located in positions as previously shown in FIG. 2,those positions being the same as those of motion merge. The order ofderivation for the left side of the current PU is defined as A₀, A₁, andscaled A₀, scaled A₁. The order of derivation for the above side of thecurrent PU is defined as B₀, B₁, B₂, scaled B₀, scaled B₁, scaled B₂.For each side there are therefore four cases that can be used as motionvector candidate, with two cases not required to use spatial scaling,and two cases where spatial scaling is used. The four different casesare summarized as follows:

-   -   No spatial scaling        -   (1) Same reference picture list, and same reference picture            index (same POC)        -   (2) Different reference picture list, but same reference            picture (same POC)    -   Spatial scaling        -   (3) Same reference picture list, but different reference            picture (different POC)        -   (4) Different reference picture list, and different            reference picture (different POC)

The no-spatial-scaling cases are checked first followed by the casesthat allow spatial scaling. Spatial scaling is considered when the POCis different between the reference picture of the neighbouring PU andthat of the current PU regardless of reference picture list. If all PUsof left candidates are not available or are intra coded, scaling for theabove motion vector is allowed to help parallel derivation of left andabove MV candidates. Otherwise, spatial scaling is not allowed for theabove motion vector.

As shown in the example in FIG. 9, for the spatial scaling case, themotion vector of the neighbouring PU is scaled in a similar manner asfor temporal scaling. One difference is that the reference picture listand index of current PU is given as input; the actual scaling process isthe same as that of temporal scaling.

1.2.3 Constructing Temporal Motion Vector Candidates

Apart from the reference picture index derivation, all processes for thederivation of temporal merge candidates are the same as for thederivation of spatial motion vector candidates (as shown in the examplein FIG. 6). In some embodiments, the reference picture index is signaledto the decoder.

2. Example of Inter Prediction Methods in Joint Exploration Model (JEM)

In some embodiments, future video coding technologies are explored usinga reference software known as the Joint Exploration Model (JEM). In JEM,sub-block based prediction is adopted in several coding tools, such asaffine prediction, alternative temporal motion vector prediction(ATMVP), spatial-temporal motion vector prediction (STMVP),bi-directional optical flow (BIO), Frame-Rate Up Conversion (FRUC),Locally Adaptive Motion Vector Resolution (LAMVR), Overlapped BlockMotion Compensation (OBMC), Local Illumination Compensation (LIC), andDecoder-side Motion Vector Refinement (DMVR).

2.1 Examples of Sub-CU Based Motion Vector Prediction

In the JEM with quadtrees plus binary trees (QTBT), each CU can have atmost one set of motion parameters for each prediction direction. In someembodiments, two sub-CU level motion vector prediction methods areconsidered in the encoder by splitting a large CU into sub-CUs andderiving motion information for all the sub-CUs of the large CU.Alternative temporal motion vector prediction (ATMVP) method allows eachCU to fetch multiple sets of motion information from multiple blockssmaller than the current CU in the collocated reference picture. Inspatial-temporal motion vector prediction (STMVP) method motion vectorsof the sub-CUs are derived recursively by using the temporal motionvector predictor and spatial neighbouring motion vector. In someembodiments, and to preserve more accurate motion field for sub-CUmotion prediction, the motion compression for the reference frames maybe disabled.

2.1.1 Examples of Alternative Temporal Motion Vector Prediction (ATMVP)

In the ATMVP method, the temporal motion vector prediction (TMVP) methodis modified by fetching multiple sets of motion information (includingmotion vectors and reference indices) from blocks smaller than thecurrent CU.

FIG. 10 shows an example of ATMVP motion prediction process for a CU1000. The ATMVP method predicts the motion vectors of the sub-CUs 1001within a CU 1000 in two steps. The first step is to identify thecorresponding block 1051 in a reference picture 1050 with a temporalvector. The reference picture 1050 is also referred to as the motionsource picture. The second step is to split the current CU 1000 intosub-CUs 1001 and obtain the motion vectors as well as the referenceindices of each sub-CU from the block corresponding to each sub-CU.

In the first step, a reference picture 1050 and the corresponding blockis determined by the motion information of the spatial neighboringblocks of the current CU 1000. To avoid the repetitive scanning processof neighboring blocks, the first merge candidate in the merge candidatelist of the current CU 1000 is used. The first available motion vectoras well as its associated reference index are set to be the temporalvector and the index to the motion source picture. This way, thecorresponding block may be more accurately identified, compared withTMVP, wherein the corresponding block (sometimes called collocatedblock) is always in a bottom-right or center position relative to thecurrent CU.

In the second step, a corresponding block of the sub-CU 1051 isidentified by the temporal vector in the motion source picture 1050, byadding to the coordinate of the current CU the temporal vector. For eachsub-CU, the motion information of its corresponding block (e.g., thesmallest motion grid that covers the center sample) is used to derivethe motion information for the sub-CU. After the motion information of acorresponding N×N block is identified, it is converted to the motionvectors and reference indices of the current sub-CU, in the same way asTMVP of HEVC, wherein motion scaling and other procedures apply. Forexample, the decoder checks whether the low-delay condition (e.g. thePOCs of all reference pictures of the current picture are smaller thanthe POC of the current picture) is fulfilled and possibly uses motionvector MVx (e.g., the motion vector corresponding to reference picturelist X) to predict motion vector MVy (e.g., with×being equal to 0 or 1and Y being equal to 1−X) for each sub-CU.

2.1.2 Examples of Spatial-Temporal Motion Vector Prediction (STMVP)

In the STMVP method, the motion vectors of the sub-CUs are derivedrecursively, following raster scan order. FIG. 11 shows an example ofone CU with four sub-blocks and neighboring blocks. Consider an 8×8 CU1100 that includes four 4×4 sub-CUs A (1101), B (1102), C (1103), and D(1104). The neighboring 4×4 blocks in the current frame are labelled asa (1111), b (1112), c (1113), and d (1114).

The motion derivation for sub-CU A starts by identifying its two spatialneighbors. The first neighbor is the N×N block above sub-CU A 1101(block c 1113). If this block c (1113) is not available or is intracoded the other N×N blocks above sub-CU A (1101) are checked (from leftto right, starting at block c 1113). The second neighbor is a block tothe left of the sub-CU A 1101 (block b 1112). If block b (1112) is notavailable or is intra coded other blocks to the left of sub-CU A 1101are checked (from top to bottom, staring at block b 1112). The motioninformation obtained from the neighboring blocks for each list is scaledto the first reference frame for a given list. Next, temporal motionvector predictor (TMVP) of sub-block A 1101 is derived by following thesame procedure of TMVP derivation as specified in HEVC. The motioninformation of the collocated block at block D 1104 is fetched andscaled accordingly. Finally, after retrieving and scaling the motioninformation, all available motion vectors are averaged separately foreach reference list. The averaged motion vector is assigned as themotion vector of the current sub-CU.

2.1.3 Examples of Sub-CU Motion Prediction Mode Signaling

In some embodiments, the sub-CU modes are enabled as additional mergecandidates and there is no additional syntax element required to signalthe modes. Two additional merge candidates are added to merge candidateslist of each CU to represent the ATMVP mode and STMVP mode. In otherembodiments, up to seven merge candidates may be used, if the sequenceparameter set indicates that ATMVP and STMVP are enabled. The encodinglogic of the additional merge candidates is the same as for the mergecandidates in the HM, which means, for each CU in P or B slice, two moreRD checks may be needed for the two additional merge candidates. In someembodiments, e.g., JEM, all bins of the merge index are context coded byCABAC (Context-based Adaptive Binary Arithmetic Coding). In otherembodiments, e.g., HEVC, only the first bin is context coded and theremaining bins are context by-pass coded.

2.2 Examples of Adaptive Motion Vector Difference Resolution

In some embodiments, motion vector differences (MVDs) (between themotion vector and predicted motion vector of a PU) are signalled inunits of quarter luma samples when use_integer_mv_flag is equal to 0 inthe slice header. In the JEM, a locally adaptive motion vectorresolution (LAMVR) is introduced. In the JEM, MVD can be coded in unitsof quarter luma samples, integer luma samples or four luma samples. TheMVD resolution is controlled at the coding unit (CU) level, and MVDresolution flags are conditionally signalled for each CU that has atleast one non-zero MVD components.

For a CU that has at least one non-zero MVD components, a first flag issignalled to indicate whether quarter luma sample MV precision is usedin the CU. When the first flag (equal to 1) indicates that quarter lumasample MV precision is not used, another flag is signalled to indicatewhether integer luma sample MV precision or four luma sample MVprecision is used.

When the first MVD resolution flag of a CU is zero, or not coded for aCU (meaning all MVDs in the CU are zero), the quarter luma sample MVresolution is used for the CU. When a CU uses integer-luma sample MVprecision or four-luma-sample MV precision, the MVPs in the AMVPcandidate list for the CU are rounded to the corresponding precision.

In the encoder, CU-level RD checks are used to determine which MVDresolution is to be used for a CU. That is, the CU-level RD check isperformed three times for each MVD resolution. To accelerate encoderspeed, the following encoding schemes are applied in the JEM:

-   -   During RD check of a CU with normal quarter luma sample MVD        resolution, the motion information of the current CU (integer        luma sample accuracy) is stored. The stored motion information        (after rounding) is used as the starting point for further small        range motion vector refinement during the RD check for the same        CU with integer luma sample and 4 luma sample MVD resolution so        that the time-consuming motion estimation process is not        duplicated three times.    -   RD check of a CU with 4 luma sample MVD resolution is        conditionally invoked. For a CU, when RD cost integer luma        sample MVD resolution is much larger than that of quarter luma        sample MVD resolution, the RD check of 4 luma sample MVD        resolution for the CU is skipped.

2.3 Examples of Higher Motion Vector Storage Accuracy

In HEVC, motion vector accuracy is one-quarter pel (one-quarter lumasample and one-eighth chroma sample for 4:2:0 video). In the JEM, theaccuracy for the internal motion vector storage and the merge candidateincreases to 1/16 pel. The higher motion vector accuracy ( 1/16 pel) isused in motion compensation inter prediction for the CU coded withskip/merge mode. For the CU coded with normal AMVP mode, either theinteger-pel or quarter-pel motion is used.

SHVC upsampling interpolation filters, which have same filter length andnormalization factor as HEVC motion compensation interpolation filters,are used as motion compensation interpolation filters for the additionalfractional pel positions. The chroma component motion vector accuracy is1/32 sample in the JEM, the additional interpolation filters of 1/32 pelfractional positions are derived by using the average of the filters ofthe two neighbouring 1/16 pel fractional positions.

2.4 Examples of Overlapped Block Motion Compensation (OBMC)

In the JEM, OBMC can be switched on and off using syntax at the CUlevel. When OBMC is used in the JEM, the OBMC is performed for allmotion compensation (MC) block boundaries except the right and bottomboundaries of a CU. Moreover, it is applied for both the luma and chromacomponents. In the JEM, an MC block corresponds to a coding block. Whena CU is coded with sub-CU mode (includes sub-CU merge, affine and FRUCmode), each sub-block of the CU is a MC block. To process CU boundariesin a uniform fashion, OBMC is performed at sub-block level for all MCblock boundaries, where sub-block size is set equal to 4×4, as shown inFIGS. 12A and 12B.

FIG. 12A shows sub-blocks at the CU/PU boundary, and the hatchedsub-blocks are where OBMC applies. Similarly, FIG. 12B shows the sub-Pusin ATMVP mode.

When OBMC applies to the current sub-block, besides current motionvectors, motion vectors of four connected neighboring sub-blocks, ifavailable and are not identical to the current motion vector, are alsoused to derive prediction block for the current sub-block. Thesemultiple prediction blocks based on multiple motion vectors are combinedto generate the final prediction signal of the current sub-block.

Prediction block based on motion vectors of a neighboring sub-block isdenoted as PN, with N indicating an index for the neighboring above,below, left and right sub-blocks and prediction block based on motionvectors of the current sub-block is denoted as PC. When PN is based onthe motion information of a neighboring sub-block that contains the samemotion information to the current sub-block, the OBMC is not performedfrom PN. Otherwise, every sample of PN is added to the same sample inPC, i.e., four rows/columns of PN are added to PC. The weighting factors{¼, ⅛, 1/16, 1/32} are used for PN and the weighting factors {¾, ⅞,15/16, 31/32} are used for PC. The exception are small MC blocks, (i.e.,when height or width of the coding block is equal to 4 or a CU is codedwith sub-CU mode), for which only two rows/columns of PN are added toPC. In this case weighting factors {¼, ⅛} are used for PN and weightingfactors {¾, ⅞} are used for PC. For PN generated based on motion vectorsof vertically (horizontally) neighboring sub-block, samples in the samerow (column) of PN are added to PC with a same weighting factor.

In the JEM, for a CU with size less than or equal to 256 luma samples, aCU level flag is signaled to indicate whether OBMC is applied or not forthe current CU. For the CUs with size larger than 256 luma samples ornot coded with AMVP mode, OBMC is applied by default. At the encoder,when OBMC is applied for a CU, its impact is taken into account duringthe motion estimation stage. The prediction signal formed by OBMC usingmotion information of the top neighboring block and the left neighboringblock is used to compensate the top and left boundaries of the originalsignal of the current CU, and then the normal motion estimation processis applied.

2.5 Examples of Local Illumination Compensation (LIC)

LIC is based on a linear model for illumination changes, using a scalingfactor a and an offset b. And it is enabled or disabled adaptively foreach inter-mode coded coding unit (CU).

When LIC applies for a CU, a least square error method is employed toderive the parameters a and b by using the neighboring samples of thecurrent CU and their corresponding reference samples. FIG. 13 shows anexample of neighboring samples used to derive parameters of the ICalgorithm. Specifically, and as shown in FIG. 13, the subsampled (2:1subsampling) neighbouring samples of the CU and the correspondingsamples (identified by motion information of the current CU or sub-CU)in the reference picture are used. The IC parameters are derived andapplied for each prediction direction separately.

When a CU is coded with merge mode, the LIC flag is copied fromneighboring blocks, in a way similar to motion information copy in mergemode; otherwise, an LIC flag is signaled for the CU to indicate whetherLIC applies or not.

When LIC is enabled for a picture, an additional CU level RD check isneeded to determine whether LIC is applied or not for a CU. When LIC isenabled for a CU, the mean-removed sum of absolute difference (MR-SAD)and mean-removed sum of absolute Hadamard-transformed difference(MR-SATD) are used, instead of SAD and SATD, for integer pel motionsearch and fractional pel motion search, respectively.

To reduce the encoding complexity, the following encoding scheme isapplied in the JEM:

-   -   LIC is disabled for the entire picture when there is no obvious        illumination change between a current picture and its reference        pictures. To identify this situation, histograms of a current        picture and every reference picture of the current picture are        calculated at the encoder. If the histogram difference between        the current picture and every reference picture of the current        picture is smaller than a given threshold, LIC is disabled for        the current picture; otherwise, LIC is enabled for the current        picture.

2.6 Examples of Affine Motion Compensation Prediction

In HEVC, only a translation motion model is applied for motioncompensation prediction (MCP). However, the camera and objects may havemany kinds of motion, e.g. zoom in/out, rotation, perspective motions,and/or other irregular motions. JEM, on the other hand, applies asimplified affine transform motion compensation prediction. FIG. 14shows an example of an affine motion field of a block 1400 described bytwo control point motion vectors V₀ and V₁. The motion vector field(MVF) of the block 1400 can be described by the following equation:

$\begin{matrix}\left\{ \begin{matrix}{v_{x} = {{\frac{\left( {v_{1x} - v_{0x}} \right)}{w}x} - {\frac{\left( {v_{1y} - v_{0y}} \right)}{w}y} + v_{0x}}} \\{v_{y} = {{\frac{\left( {v_{1y} - v_{0y}} \right)}{w}x} + {\frac{\left( {v_{1x} - v_{0x}} \right)}{w}y} + v_{0y}}}\end{matrix} \right. & {{Eq}.\mspace{14mu} (1)}\end{matrix}$

As shown in FIG. 14, (v_(0x), v_(0y)) is motion vector of the top-leftcorner control point, and (v_(1x), v_(1y)) is motion vector of thetop-right corner control point. To simplify the motion compensationprediction, sub-block based affine transform prediction can be applied.The sub-block size M×N is derived as follows:

$\begin{matrix}\left\{ \begin{matrix}{M = {{clip}\; 3\ \left( {4,w,\ \frac{w \times {MvPre}}{\max \left( {{{abs}\left( {v_{1x} - v_{0x}} \right)},{{abs}\left( {v_{1y} - v_{0y}} \right)}} \right)}} \right)}} \\{N = {{clip}\; 3\ \left( {4,h,\ \frac{h \times {MvPre}}{\max \left( {{{abs}\left( {v_{2x} - v_{0x}} \right)},{{abs}\left( {v_{2y} - v_{0y}} \right)}} \right)}} \right)}}\end{matrix} \right. & {{Eq}.\mspace{14mu} (2)}\end{matrix}$

Here, MvPre is the motion vector fraction accuracy (e.g., 1/16 in JEM).(v_(2x), v_(2y)) is motion vector of the bottom-left control point,calculated according to Eq. (1). M and N can be adjusted downward ifnecessary to make it a divisor of w and h, respectively.

FIG. 15 shows an example of affine MVF per sub-block for a block 1500.To derive motion vector of each M×N sub-block, the motion vector of thecenter sample of each sub-block can be calculated according to Eq. (1),and rounded to the motion vector fraction accuracy (e.g., 1/16 in JEM).Then the motion compensation interpolation filters can be applied togenerate the prediction of each sub-block with derived motion vector.After the MCP, the high accuracy motion vector of each sub-block isrounded and saved as the same accuracy as the normal motion vector.

2.6.1 Embodiments of the AF_INTER Mode

In the JEM, there are two affine motion modes: AF_INTER mode andAF_MERGE mode. For CUs with both width and height larger than 8,AF_INTER mode can be applied. An affine flag in CU level is signaled inthe bitstream to indicate whether AF_INTER mode is used. In the AF_INTERmode, a candidate list with motion vector pair {(v₀, v₁)|v₀={v_(A),v_(B), v_(C)}, v₁={v_(D),v_(E)}} is constructed using the neighboringblocks.

FIG. 16 shows an example of motion vector prediction (MVP) for a block1600 in the AF_INTER mode. As shown in FIG. 16, v₀ is selected from themotion vectors of the sub-block A, B, or C. The motion vectors from theneighboring blocks can be scaled according to the reference list. Themotion vectors can also be scaled according to the relationship amongthe Picture Order Count (POC) of the reference for the neighboringblock, the POC of the reference for the current CU, and the POC of thecurrent CU. The approach to select v₁ from the neighboring sub-block Dand E is similar. If the number of candidate list is smaller than 2, thelist is padded by the motion vector pair composed by duplicating each ofthe AMVP candidates. When the candidate list is larger than 2, thecandidates can be firstly sorted according to the neighboring motionvectors (e.g., based on the similarity of the two motion vectors in apair candidate). In some implementations, the first two candidates arekept. In some embodiments, a Rate Distortion (RD) cost check is used todetermine which motion vector pair candidate is selected as the controlpoint motion vector prediction (CPMVP) of the current CU. An indexindicating the position of the CPMVP in the candidate list can besignaled in the bitstream. After the CPMVP of the current affine CU isdetermined, affine motion estimation is applied and the control pointmotion vector (CPMV) is found. Then the difference of the CPMV and theCPMVP is signaled in the bitstream.

2.6.3 Embodiments of the AF_MERGE Mode

When a CU is applied in AF_MERGE mode, it gets the first block codedwith an affine mode from the valid neighboring reconstructed blocks.FIG. 17A shows an example of the selection order of candidate blocks fora current CU 1700. As shown in FIG. 17A, the selection order can be fromleft (1701), above (1702), above right (1703), left bottom (1704) toabove left (1705) of the current CU 1700. FIG. 17B shows another exampleof candidate blocks for a current CU 1700 in the AF_MERGE mode. If theneighboring left bottom block 1801 is coded in affine mode, as shown inFIG. 17B, the motion vectors v₂, v₃ and v₄ of the top left corner, aboveright corner, and left bottom corner of the CU containing the sub-block1701 are derived. The motion vector v₀ of the top left corner on thecurrent CU 1700 is calculated based on v2, v3 and v4. The motion vectorv1 of the above right of the current CU can be calculated accordingly.

After the CPMV of the current CU v0 and v1 are computed according to theaffine motion model in Eq. (1), the MVF of the current CU can begenerated. In order to identify whether the current CU is coded withAF_MERGE mode, an affine flag can be signaled in the bitstream whenthere is at least one neighboring block is coded in affine mode.

2.7 Examples of Pattern Matched Motion Vector Derivation (PMMVD)

The PMMVD mode is a special merge mode based on the Frame-Rate UpConversion (FRUC) method. With this mode, motion information of a blockis not signaled but derived at decoder side.

A FRUC flag can be signaled for a CU when its merge flag is true. Whenthe FRUC flag is false, a merge index can be signaled and the regularmerge mode is used. When the FRUC flag is true, an additional FRUC modeflag can be signaled to indicate which method (e.g., bilateral matchingor template matching) is to be used to derive motion information for theblock.

At the encoder side, the decision on whether using FRUC merge mode for aCU is based on RD cost selection as done for normal merge candidate. Forexample, multiple matching modes (e.g., bilateral matching and templatematching) are checked for a CU by using RD cost selection. The oneleading to the minimal cost is further compared to other CU modes. If aFRUC matching mode is the most efficient one, FRUC flag is set to truefor the CU and the related matching mode is used.

Typically, motion derivation process in FRUC merge mode has two steps: aCU-level motion search is first performed, then followed by a Sub-CUlevel motion refinement. At CU level, an initial motion vector isderived for the whole CU based on bilateral matching or templatematching. First, a list of MV candidates is generated and the candidatethat leads to the minimum matching cost is selected as the startingpoint for further CU level refinement. Then a local search based onbilateral matching or template matching around the starting point isperformed. The MV results in the minimum matching cost is taken as theMV for the whole CU. Subsequently, the motion information is furtherrefined at sub-CU level with the derived CU motion vectors as thestarting points.

For example, the following derivation process is performed for a W×H CUmotion information derivation. At the first stage, MV for the whole W×HCU is derived. At the second stage, the CU is further split into M×Msub-CUs. The value of M is calculated as in Eq. (3), D is a predefinedsplitting depth which is set to 3 by default in the JEM. Then the MV foreach sub-CU is derived.

$\begin{matrix}{M = {\max \left\{ {4,{\min \left\{ {\frac{M}{2^{D}},\frac{N}{2^{D}}} \right\}}} \right\}}} & {{Eq}.\mspace{14mu} (3)}\end{matrix}$

FIG. 18 shows an example of bilateral matching used in the Frame-Rate UpConversion (FRUC) method. The bilateral matching is used to derivemotion information of the current CU by finding the closest matchbetween two blocks along the motion trajectory of the current CU (1800)in two different reference pictures (1810, 1811). Under the assumptionof continuous motion trajectory, the motion vectors MV0 (1801) and MV1(1802) pointing to the two reference blocks are proportional to thetemporal distances, e.g., TD0 (1803) and TD1 (1804), between the currentpicture and the two reference pictures. In some embodiments, when thecurrent picture 1800 is temporally between the two reference pictures(1810, 1811) and the temporal distance from the current picture to thetwo reference pictures is the same, the bilateral matching becomesmirror based bi-directional MV.

FIG. 19 shows an example of template matching used in the Frame-Rate UpConversion (FRUC) method. Template matching can be used to derive motioninformation of the current CU 1900 by finding the closest match betweena template (e.g., top and/or left neighboring blocks of the current CU)in the current picture and a block (e.g., same size to the template) ina reference picture 1910. Except the aforementioned FRUC merge mode, thetemplate matching can also be applied to AMVP mode. In both JEM andHEVC, AMVP has two candidates. With the template matching method, a newcandidate can be derived. If the newly derived candidate by templatematching is different to the first existing AMVP candidate, it isinserted at the very beginning of the AMVP candidate list and then thelist size is set to two (e.g., by removing the second existing AMVPcandidate). When applied to AMVP mode, only CU level search is applied.

The MV candidate set at CU level can include the following: (1) originalAMVP candidates if the current CU is in AMVP mode, (2) all mergecandidates, (3) several MVs in the interpolated MV field (describedlater), and top and left neighboring motion vectors.

When using bilateral matching, each valid MV of a merge candidate can beused as an input to generate a MV pair with the assumption of bilateralmatching. For example, one valid MV of a merge candidate is (MVa,ref_(a)) at reference list A. Then the reference picture ref_(b) of itspaired bilateral MV is found in the other reference list B so thatref_(a) and ref_(b) are temporally at different sides of the currentpicture. If such a ref_(b) is not available in reference list B, ref_(b)is determined as a reference which is different from ref_(a) and itstemporal distance to the current picture is the minimal one in list B.After ref_(b) is determined, MVb is derived by scaling MVa based on thetemporal distance between the current picture and ref_(a), ref_(b).

In some implementations, four MVs from the interpolated MV field canalso be added to the CU level candidate list. More specifically, theinterpolated MVs at the position (0, 0), (W/2, 0), (0, H/2) and (W/2,H/2) of the current CU are added. When FRUC is applied in AMVP mode, theoriginal AMVP candidates are also added to CU level MV candidate set. Insome implementations, at the CU level, 15 MVs for AMVP CUs and 13 MVsfor merge CUs can be added to the candidate list.

The MV candidate set at sub-CU level includes an MV determined from aCU-level search, (2) top, left, top-left and top-right neighboring MVs,(3) scaled versions of collocated MVs from reference pictures, (4) oneor more ATMVP candidates (e.g., up to four), and (5) one or more STMVPcandidates (e.g., up to four). The scaled MVs from reference picturesare derived as follows. The reference pictures in both lists aretraversed. The MVs at a collocated position of the sub-CU in a referencepicture are scaled to the reference of the starting CU-level MV. ATMVPand STMVP candidates can be the four first ones. At the sub-CU level,one or more MVs (e.g., up to 17) are added to the candidate list.

Generation of an interpolated MV field. Before coding a frame,interpolated motion field is generated for the whole picture based onunilateral ME. Then the motion field may be used later as CU level orsub-CU level MV candidates.

In some embodiments, the motion field of each reference pictures in bothreference lists is traversed at 4×4 block level. FIG. 20 shows anexample of unilateral Motion Estimation (ME) 2000 in the FRUC method.For each 4×4 block, if the motion associated to the block passingthrough a 4×4 block in the current picture and the block has not beenassigned any interpolated motion, the motion of the reference block isscaled to the current picture according to the temporal distance TD0 andTD1 (the same way as that of MV scaling of TMVP in HEVC) and the scaledmotion is assigned to the block in the current frame. If no scaled MV isassigned to a 4×4 block, the block's motion is marked as unavailable inthe interpolated motion field.

Interpolation and matching cost. When a motion vector points to afractional sample position, motion compensated interpolation is needed.To reduce complexity, bi-linear interpolation instead of regular 8-tapHEVC interpolation can be used for both bilateral matching and templatematching.

The calculation of matching cost is a bit different at different steps.When selecting the candidate from the candidate set at the CU level, thematching cost can be the absolute sum difference (SAD) of bilateralmatching or template matching. After the starting MV is determined, thematching cost C of bilateral matching at sub-CU level search iscalculated as follows:

C=SAD+w·(|MV _(x) −MV _(x) ^(s) |+|MV _(y) −MV _(y) ^(s)|)  Eq. (4)

Here, w is a weighting factor. In some embodiments, w can be empiricallyset to 4. MV and MV^(s) indicate the current MV and the starting MV,respectively. SAD may still be used as the matching cost of templatematching at sub-CU level search.

In FRUC mode, MV is derived by using luma samples only. The derivedmotion will be used for both luma and chroma for MC inter prediction.After MV is decided, final MC is performed using 8-taps interpolationfilter for luma and 4-taps interpolation filter for chroma.

MV refinement is a pattern based MV search with the criterion ofbilateral matching cost or template matching cost. In the JEM, twosearch patterns are supported—an unrestricted center-biased diamondsearch (UCBDS) and an adaptive cross search for MV refinement at the CUlevel and sub-CU level, respectively. For both CU and sub-CU level MVrefinement, the MV is directly searched at quarter luma sample MVaccuracy, and this is followed by one-eighth luma sample MV refinement.The search range of MV refinement for the CU and sub-CU step are setequal to 8 luma samples.

In the bilateral matching merge mode, bi-prediction is applied becausethe motion information of a CU is derived based on the closest matchbetween two blocks along the motion trajectory of the current CU in twodifferent reference pictures. In the template matching merge mode, theencoder can choose among uni-prediction from list0, uni-prediction fromlist1, or bi-prediction for a CU. The selection ca be based on atemplate matching cost as follows:

If costBi<=factor*min (cost0, cost1)

-   -   bi-prediction is used;    -   Otherwise, if cost0<=cost1    -   uni-prediction from list0 is used;    -   Otherwise,    -   uni-prediction from list1 is used;

Here, cost0 is the SAD of list0 template matching, cost1 is the SAD oflist1 template matching and costBi is the SAD of bi-prediction templatematching. For example, when the value of factor is equal to 1.25, itmeans that the selection process is biased toward bi-prediction. Theinter prediction direction selection can be applied to the CU-leveltemplate matching process.

2.8 Examples of Generalized Bi-Prediction (GBI)

In conventional bi-prediction, the predictors from L0 and L1 areaveraged to generate the final predictor using the equal weight 0.5. Thepredictor generation formula is shown as in Equation (5).

P _(TraditionalBiPred)=(P _(L0) +P _(L1)+RoundingOffset)>>shiftNum  Eq.(5)

In Equation (5), P_(TraditionalBiPred) is the final predictor for theconventional bi-prediction, P_(L0) and P_(L1) are predictors from L0 andL1, respectively, and RoundingOffset and shiftNum are used to normalizethe final predictor.

Generalized bi-prediction (GBI) proposes to allow applying differentweights to predictors from L0 and L1. The predictor generation is shownin Equation (6).

P _(GBi)=((1−w ₁)*P _(L0) +w ₁ *P_(L1)+RoundingOffset_(GBi))>>shiftNum_(GBi),  Eq. (6)

In Equation (6), P_(GBi) is the final predictor of GBi. (1−w₁) and w₁are the selected GBI weights applied to the predictors of L0 and L1,respectively. RoundingOffset_(GBi) and shiftNum_(GBi) are used tonormalize the final predictor in GBi.

The supported weights of w₁ is {−¼, ⅜, ½, ⅝, 5/4}. One equal-weight setand four unequal-weight sets are supported. For the equal-weight case,the process to generate the final predictor is exactly the same as thatin the conventional bi-prediction mode. For the true bi-prediction casesin random access (RA) condition, the number of candidate weight sets isreduced to three.

For advanced motion vector prediction (AMVP) mode, the weight selectionin GBI is explicitly signaled at CU-level if this CU is coded bybi-prediction. For merge mode, the weight selection is inherited fromthe merge candidate. In this proposal, GBI supports DMVR to generate theweighted average of template as well as the final predictor for BMS-1.0.

2.9 Examples of Multi-Hypothesis Inter Prediction

In the multi-hypothesis inter prediction mode, one or more additionalprediction signals are signaled, in addition to the conventional uni/biprediction signal. The resulting overall prediction signal is obtainedby sample-wise weighted superposition. With the uni/bi prediction signalp_(uni/bi) and the first additional inter prediction signal/hypothesish₃, the resulting prediction signal p₃ is obtained as follows:

p ₃=(1−α)p _(uni/bi) +αh ₃

The changes to the prediction unit syntax structure are shown below:

Descriptor prediction_unit( x0, y0, nPbW, nPbH ) { ... if( !cu_skip_flag[ x0 ][ y0 ] ) { i = 0 readMore = 1 while( i <MaxNumAdditionalHypotheses && readMore ) { additional_hypothesis_flag[x0 ][ y0 ][ i ] ae(v) if( additional_hypothesis_flag[ x0 ][ y0 ][ i ] ){ ref_idx_add_hyp[ x0 ][ y0 ][ i ] ae(v) mvd_coding( x0, y0, 2+i )mvp_add_hyp_flag[ x0 ][ y0 ][ i ] ae(v) add_hyp_weight_idx[ x0 ][ y0 ][i ] ae(v) } readMore = additional_hypothesis_flag[ x0 ][ y0 ][ i ] i++ }} }

The weighting factor a is specified by the syntax elementadd_hyp_weight_idx, according to the following mapping:

add_hyp_weight_idx α 0  1/4 1 −1/8

In some embodiments, and for the additional prediction signals, theconcept of prediction list0/list1 is abolished, and instead one combinedlist is used. This combined list is generated by alternatingly insertingreference frames from list0 and list1 with increasing reference index,omitting reference frames which have already been inserted, such thatdouble entries are avoided.

In some embodiments, and analogously to the above, more than oneadditional prediction signals can be used. The resulting overallprediction signal is accumulated iteratively with each additionalprediction signal.

p _(n+1)=(1−α_(n+1))p _(n)+α_(n+1) h _(n+1)

The resulting overall prediction signal is obtained as the last p_(n)(i.e., the p_(n) having the largest index n).

Note that also for inter prediction blocks using MERGE mode (but notSKIP mode), additional inter prediction signals can be specified.Further note, that in case of MERGE, not only the uni/bi predictionparameters, but also the additional prediction parameters of theselected merging candidate can be used for the current block.

2.10 Examples of Multi-Hypothesis Prediction for Uni-Prediction of AMVPMode

In some embodiments, when the multi-hypothesis prediction is applied toimprove uni-prediction of AMVP mode, one flag is signaled to enable ordisable multi-hypothesis prediction for inter_dir equal to 1 or 2, where1, 2, and 3 represent list 0, list 1, and bi-prediction, respectively.Moreover, one more merge index is signaled when the flag is true. Inthis way, multi-hypothesis prediction turns uni-prediction intobi-prediction, where one motion is acquired using the original syntaxelements in AMVP mode while the other is acquired using the mergescheme. The final prediction uses 1:1 weights to combine these twopredictions as in bi-prediction. The merge candidate list is firstderived from merge mode with sub-CU candidates (e.g., affine,alternative temporal motion vector prediction (ATMVP)) excluded. Next,it is separated into two individual lists, one for list 0 (L0)containing all L0 motions from the candidates, and the other for list 1(L1) containing all L1 motions. After removing redundancy and fillingvacancy, two merge lists are generated for L0 and L1 respectively. Thereare two constraints when applying multi-hypothesis prediction forimproving AMVP mode. First, it is enabled for those CUs with the lumacoding block (CB) area larger than or equal to 64. Second, it is onlyapplied to L1 when in low delay B pictures.

2.11 Examples of Multi-Hypothesis Prediction for Skip/Merge Mode

In some embodiments, when the multi-hypothesis prediction is applied toskip or merge mode, whether to enable multi-hypothesis prediction isexplicitly signaled. An extra merge indexed prediction is selected inaddition to the original one. Therefore, each candidate ofmulti-hypothesis prediction implies a pair of merge candidates,containing one for the 1^(st) merge indexed prediction and the other forthe 2^(nd) merge indexed prediction. However, in each pair, the mergecandidate for the 2^(nd) merge indexed prediction is implicitly derivedas the succeeding merge candidate (i.e., the already signaled mergeindex plus one) without signaling any additional merge index. Afterremoving redundancy by excluding those pairs, containing similar mergecandidates and filling vacancy, the candidate list for multi-hypothesisprediction is formed. Then, motions from a pair of two merge candidatesare acquired to generate the final prediction, where 5:3 weights areapplied to the 1^(st) and 2^(nd) merge indexed predictions,respectively. Moreover, a merge or skip CU with multi-hypothesisprediction enabled can save the motion information of the additionalhypotheses for reference of the following neighboring CUs in addition tothe motion information of the existing hypotheses.

Note that sub-CU candidates (e.g., affine, ATMVP) are excluded from thecandidate list, and for low delay B pictures, multi-hypothesisprediction is not applied to skip mode. Moreover, when multi-hypothesisprediction is applied to merge or skip mode, for those CUs with CU widthor CU height less than 16, or those CUs with both CU width and CU heightequal to 16, bi-linear interpolation filter is used in motioncompensation for multiple hypotheses. Therefore, the worst-casebandwidth (required access samples per sample) for each merge or skip CUwith multi-hypothesis prediction enabled is less than half of theworst-case bandwidth for each 4×4 CU with multi-hypothesis predictiondisabled.

2.12 Examples of Ultimate Motion Vector Expression (UMVE)

In some embodiments, ultimate motion vector expression (UMVE), which isalso referred to as merge with MVD (MMVD), is presented. The UMVE modeis used for either skip or merge modes with a proposed motion vectorexpression method.

UMVE re-uses merge candidate as same as using in VVC. Among the mergecandidates, a candidate can be selected, and is further expanded by theproposed motion vector expression method.

UMVE provides a new motion vector expression with simplified signaling.The expression method includes starting point, motion magnitude, andmotion direction. This proposed technique uses a merge candidate list asit is. But only candidates which are default merge type(MRG_TYPE_DEFAULT_N) are considered for UMVE's expansion.

Base candidate index defines the starting point. Base candidate indexindicates the best candidate among candidates in the list as follows.

Base candidate IDX 0 1 2 3 N^(th) MVP 1^(st) MVP 2^(nd) MVP 3^(rd) MVP4^(th) MVP

If the number of base candidate is equal to 1, Base candidate IDX is notsignaled.

Distance index is motion magnitude information. Distance index indicatesthe pre-defined distance from the starting point information.Pre-defined distance is as follows:

Distance IDX 0 1 2 3 4 5 6 7 Pixel 1/4- 1/2- 1-pel 2-pel 4-pel 8-pel16-pel 32-pel distance pel pel

Direction index represents the direction of the MVD relative to thestarting point. The direction index can represent of the four directionsas shown below:

Direction IDX 00 01 10 11 x-axis + − N/A N/A y-axis N/A N/A + −

UMVE flag is signaled right after sending a skip flag and merge flag. Ifskip and merge flag is true, UMVE flag is parsed. If UMVE flage is equalto 1, UMVE syntaxes are parsed. But, if not 1, AFFINE flag is parsed. IfAFFINE flag is equal to 1, that is AFFINE mode, But, if not 1,skip/merge index is parsed for VTM's skip/merge mode.

Additional line buffer due to UMVE candidates is not needed. Because askip/merge candidate of software is directly used as a base candidate.Using input UMVE index, the supplement of MV is decided right beforemotion compensation. There is no need to hold long line buffer for this.

2.13 Examples of Affine Merge Mode with Prediction Offsets

In some embodiments, UMVE is extended to affine merge mode, we will callthis UMVE affine mode thereafter. The proposed method selects the firstavailable affine merge candidate as a base predictor. Then it applies amotion vector offset to each control point's motion vector value fromthe base predictor. If there's no affine merge candidate available, thisproposed method will not be used.

The selected base predictor's inter prediction direction, and thereference index of each direction is used without change.

In the current implementation, the current block's affine model isassumed to be a 4-parameter model, only 2 control points need to bederived. Thus, only the first 2 control points of the base predictorwill be used as control point predictors.

For each control point, a zero_MVD flag is used to indicate whether thecontrol point of current block has the same MV value as thecorresponding control point predictor. If zero_MVD flag is true, there'sno other signaling needed for the control point. Otherwise, a distanceindex and an offset direction index is signaled for the control point.

A distance offset table with size of 5 is used as shown in the tablebelow.

Distance IDX 0 1 2 3 4 Distance-offset 1/2-pel 1-pel 2-pel 4-pel 8-pel

Distance index is signaled to indicate which distance offset to use. Themapping of distance index and distance offset values is shown in FIG.23.

The direction index can represent four directions as shown below, whereonly x or y direction may have an MV difference, but not in bothdirections.

Offset Direction IDX 00 01 10 11 x-dir-factor +1 −1 0 0 y-dir-factor 0 0+1 −1

If the inter prediction is uni-directional, the signaled distance offsetis applied on the offset direction for each control point predictor.Results will be the MV value of each control point.

For example, when base predictor is uni-directional, and the motionvector values of a control point is MVP (v_(px), v_(py)). When distanceoffset and direction index are signaled, the motion vectors of currentblock's corresponding control points will be calculated as below.

MV(v _(x) ,v _(y))=MVP(v _(px) ,v_(py))+MV(x-dir-factor*distance-offset,y-dir-factor*distance-offset)

If the inter prediction is bi-directional, the signaled distance offsetis applied on the signaled offset direction for control pointpredictor's L0 motion vector; and the same distance offset with oppositedirection is applied for control point predictor's L1 motion vector.Results will be the MV values of each control point, on each interprediction direction.

For example, when base predictor is uni-directional, and the motionvector values of a control point on L0 is MVP_(L0) (v_(0px), v_(0py)),and the motion vector of that control point on L1 is MVP_(L1) (v_(1px),v_(1py)). When distance offset and direction index are signaled, themotion vectors of current block's corresponding control points will becalculated as below.

MV _(L0)(v _(0x) ,v _(0y))=MVP _(L0)(v _(0px) ,v_(0py))+MV(x-dir-factor*distance-offset,y-dir-factor*distance-offset)

MV _(L1)(v _(0x) ,v _(0y))=MVP _(L1)(v _(0px) ,v_(0py))+MV(−x-dir-factor*distance-offset,−y-dir-factor*distance-offset)

2.14 Examples of Bi-Directional Optical Flow (BIO)

The bi-directional optical flow (BIO) method is a sample-wise motionrefinement performed on top of block-wise motion compensation forbi-prediction. In some implementations, the sample-level motionrefinement does not use signaling.

Let I^((k)) be the luma value from reference k (k=0, 1) after blockmotion compensation, and denote ∂I^((k))/∂x and ∂I^((k))/∂y as thehorizontal and vertical components of the I^((k)) gradient,respectively. Assuming the optical flow is valid, the motion vectorfield (v_(x), v_(y)) is given by:

∂I ^((k)) /∂t+v _(x) ∂I ^((k)) /∂x+v _(y) ∂I ^((k)) /∂y=0.  Eq. (5)

Combining this optical flow equation with Hermite interpolation for themotion trajectory of each sample results in a unique third-orderpolynomial that matches both the function values I^((k)) and derivatives∂I^((k))/∂x and ∂I^((k))/∂y at the ends. The value of this polynomial att=0 is the BIO prediction:

pred_(BIO)=½·(I ⁽⁰⁾ +I ⁽¹⁾ +v _(x)/2·(τ₁ ∂I ⁽¹⁾ /∂x−τ ₀ ∂I ⁽⁰⁾ /∂x)+v_(y)/2·(τ₁ ∂I ⁽¹⁾ /∂y−τ ₀ ∂I ⁽⁰⁾/∂_(y))).  Eq. (6)

FIG. 24 shows an example optical flow trajectory in the Bi-directionalOptical flow (BIO) method. Here, τ₀ and τ₁ denote the distances to thereference frames. Distances τ₀ and τ₁ are calculated based on POC forRef₀ and Ref₁: τ₀=POC(current)−POC(Ref₀), τ₁=POC(Ref₁)−POC(current). Ifboth predictions come from the same time direction (either both from thepast or both from the future) then the signs are different (e.g.,τ₀·τ₁<0). In this case, BIO is applied if the prediction is not from thesame time moment (e.g., τ₀≠τ₁). Both referenced regions have non-zeromotion (e.g. MVx₀, MVy₀, MVx₁, MVy₁≠0), and the block motion vectors areproportional to the time distance (e.g. MVx₀/MVx₁=MVy₀/MVy₁=−τ₀/τ₁).

The motion vector field (v_(x), v_(y)) is determined by minimizing thedifference Δ between values in points A and B. FIGS. 9A-9B show anexample of intersection of motion trajectory and reference frame planes.Model uses only first linear term of a local Taylor expansion for Δ:

Δ=(I ⁽⁰⁾ −I ⁽¹⁾ ₀ +v _(x)(τ₁ ∂I ⁽¹⁾ /∂x+τ ₀ ∂I ⁽⁰⁾ /∂x)+v _(y)(τ₁ ∂I ⁽¹⁾/∂y+τ ₀ ∂I ⁽⁰⁾/∂_(y)))   Eq. (7)

All values in the above equation depend on the sample location, denotedas (i′, j′). Assuming the motion is consistent in the local surroundingarea, Δ can be minimized inside the (2M+1)×(2M+1) square window Ωcentered on the currently predicted point (i,j), where M is equal to 2:

$\begin{matrix}{\left( {v_{x},v_{y}} \right) = {\underset{v_{x},v_{y}}{argmin}{\sum\limits_{{\lbrack{i^{\prime},j}\rbrack} \in \Omega}{\Delta^{2}\left\lbrack {i^{\prime},j^{\prime}} \right\rbrack}}}} & {{Eq}.\mspace{14mu} (8)}\end{matrix}$

For this optimization problem, the JEM uses a simplified approach makingfirst a minimization in the vertical direction and then in thehorizontal direction. This results in the following:

$\begin{matrix}{\mspace{79mu} {v_{x} = {{\left( {s_{1} + r} \right) > {{m?{clip}}\; 3\left( {{- {thBIO}},{thBIO},{- \frac{s_{3}}{\left( {s_{1} + r} \right)}}} \right)}}:0}}} & {{Eq}.\mspace{14mu} (9)} \\{v_{y} = {{\left( {s_{5} + r} \right) > {{m?{clip}}\; 3\left( {{- {thBIO}},{thBIO},{- \frac{s_{6} - {v_{x}{s_{2}/2}}}{\left( {s_{5} + r} \right)}}} \right)}}:0}} & {{Eq}.\mspace{14mu} (10)} \\{\mspace{79mu} {{where},}} & \; \\{\mspace{79mu} {{{s_{1} = {\sum\limits_{{\lbrack{i^{\prime},j}\rbrack} \in \Omega}\left( {{\tau_{1}{{\partial I^{(1)}}/{\partial x}}} + {\tau_{0}{{\partial I^{(0)}}/{\partial x}}}} \right)^{2}}};}\mspace{20mu} {{s_{3} = {\sum\limits_{{\lbrack{i^{\prime},j}\rbrack} \in \Omega}{\left( {I^{(1)} - I^{(0)}} \right)\left( {{\tau_{1}{{\partial I^{(1)}}/{\partial x}}} + {\tau_{0}{{\partial I^{(0)}}/{\partial x}}}} \right)}}};}{{s_{2} = {\sum\limits_{{\lbrack{i^{\prime},j}\rbrack} \in \Omega}{\left( {{\tau_{1}{{\partial I^{(1)}}/{\partial x}}} + {\tau_{0}{{\partial I^{(0)}}/{\partial x}}}} \right)\left( {{\tau_{1}{{\partial I^{(1)}}/{\partial y}}} + {\tau_{0}{{\partial I^{(0)}}/{\partial y}}}} \right)}}};}\mspace{20mu} {{s_{5} = {\sum\limits_{{\lbrack{i^{\prime},j}\rbrack} \in \Omega}\left( {{\tau_{1}{{\partial I^{(1)}}/{\partial y}}} + {\tau_{0}{{\partial I^{(0)}}/{\partial y}}}} \right)^{2}}};}\mspace{20mu} {s_{6} = {\sum\limits_{{\lbrack{i^{\prime},j}\rbrack} \in \Omega}{\left( {I^{(1)} - I^{(0)}} \right)\left( {{\tau_{1}{{\partial I^{(1)}}/{\partial y}}} + {\tau_{0}{{\partial I^{(0)}}/{\partial y}}}} \right)}}}}} & {{Eq}.\mspace{14mu} (11)}\end{matrix}$

In order to avoid division by zero or a very small value, regularizationparameters r and m can be introduced in Eq. (9) and Eq. (10), where:

r=500·4^(d-8)  Eq. (12)

m=700·4^(d-8)  Eq. (13)

Here, d is bit depth of the video samples.

In order to keep the memory access for BIO the same as for regularbi-predictive motion compensation, all prediction and gradients values,I^((k)), ∂I^((k))/∂x, ∂I^((k))/∂y, are calculated for positions insidethe current block. FIG. 25A shows an example of access positions outsideof a block 2500. As shown in FIG. 25A, in Eq. (9), (2M+1)×(2M+1) squarewindow Ω centered in currently predicted point on a boundary ofpredicted block needs to accesses positions outside of the block. In theJEM, values of I^((k)), ∂I^((k))/∂x, ∂I^((k))/∂y outside of the blockare set to be equal to the nearest available value inside the block. Forexample, this can be implemented as a padding area 2501, as shown inFIG. 25B.

With BIO, it is possible that the motion field can be refined for eachsample. To reduce the computational complexity, a block-based design ofBIO is used in the JEM. The motion refinement can be calculated based ona 4×4 block. In the block-based BIO, the values of 5. in Eq. (9) of allsamples in a 4×4 block can be aggregated, and then the aggregated valuesof s_(n) in are used to derived BIO motion vectors offset for the 4×4block. More specifically, the following formula can used for block-basedBIO derivation:

$\begin{matrix}{\mspace{79mu} {{{{s_{1,b_{k}} = {\sum\limits_{{({x,y})} \in b_{k}}{\sum\limits_{{\lbrack{i^{\prime},j}\rbrack} \in {\Omega {({x,y})}}}\left( {{\tau_{1}{{\partial I^{(1)}}/{\partial x}}} + {\tau_{0}{{\partial I^{(0)}}/{\partial x}}}} \right)^{2}}}};}{{s_{3,b_{k}} = {\sum\limits_{{({x,y})} \in b_{k}}{\sum\limits_{{\lbrack{i^{\prime},j}\rbrack} \in \Omega}{\left( {I^{(1)} - I^{(0)}} \right)\left( {{\tau_{1}{{\partial I^{(1)}}/{\partial x}}} + {\tau_{0}{{\partial I^{(0)}}/{\partial x}}}} \right)}}}};}{{s_{2,b_{k}} = {\sum\limits_{{({x,y})} \in b_{k}}{\sum\limits_{{\lbrack{i^{\prime},j}\rbrack} \in \Omega}{\left( {{\tau_{1}{{\partial I^{(1)}}/{\partial x}}} + {\tau_{0}{{\partial I^{(0)}}/{\partial x}}}} \right)\left( {{\tau_{1}{{\partial I^{(1)}}/{\partial y}}} + {\tau_{0}{{\partial I^{(0)}}/{\partial y}}}} \right)}}}};}}\mspace{20mu} {{s_{5,b_{k}} = {\sum\limits_{{({x,y})} \in b_{k}}{\sum\limits_{{\lbrack{i^{\prime},j}\rbrack} \in \Omega}\left( {{\tau_{1}{{\partial I^{(1)}}/{\partial y}}} + {\tau_{0}{{\partial I^{(0)}}/{\partial y}}}} \right)^{2}}}};}{s_{6,b_{k}} = {\sum\limits_{{({x,y})} \in b_{k}}{\sum\limits_{{\lbrack{i^{\prime},j}\rbrack} \in \Omega}{\left( {I^{(1)} - I^{(0)}} \right)\left( {{\tau_{1}{{\partial I^{(1)}}/{\partial y}}} + {\tau_{0}{{\partial I^{(0)}}/{\partial y}}}} \right)}}}}}} & {{Eq}.\mspace{14mu} (14)}\end{matrix}$

Here, bk denotes the set of samples belonging to the k-th 4×4 block ofthe predicted block. s_(n) in Eq (9) and Eq (10) are replaced by((s_(n,bk))>>4) to derive the associated motion vector offsets.

In some scenarios, MV regiment of BIO may be unreliable due to noise orirregular motion. Therefore, in BIO, the magnitude of MV regiment isclipped to a threshold value. The threshold value is determined based onwhether the reference pictures of the current picture are all from onedirection. For example, if all the reference pictures of the currentpicture are from one direction, the value of the threshold is set to12×2^(14-d); otherwise, it is set to 12×2^(13-d).

Gradients for BIO can be calculated at the same time with motioncompensation interpolation using operations consistent with HEVC motioncompensation process (e.g., 2D separable Finite Impulse Response (FIR)).In some embodiments, the input for the 2D separable FIR is the samereference frame sample as for motion compensation process and fractionalposition (fracX, fracY) according to the fractional part of block motionvector. For horizontal gradient ∂I/∂x, a signal is first interpolatedvertically using BIOfilterS corresponding to the fractional positionfracY with de-scaling shift d−8. Gradient filter BIOfilterG is thenapplied in horizontal direction corresponding to the fractional positionfracX with de-scaling shift by 18-d. For vertical gradient ∂I/∂y, agradient filter is applied vertically using BIOfilterG corresponding tothe fractional position fracY with de-scaling shift d−8. The signaldisplacement is then performed using BIOfilterS in horizontal directioncorresponding to the fractional position fracX with de-scaling shift by18-d. The length of interpolation filter for gradients calculationBIOfilterG and signal displacement BIOfilterF can be shorter (e.g.,6-tap) in order to maintain reasonable complexity. Table 1 shows examplefilters that can be used for gradients calculation of differentfractional positions of block motion vector in BIO. Table 2 showsexample interpolation filters that can be used for prediction signalgeneration in BIO.

TABLE 1 Exemplary filters for gradient calculations in BIO Fractionalpel position Interpolation filter for gradient(BIOfilterG) 0 {8, −39,−3, 46, −17, 5} 1/16 {8, −32, −13, 50, −18, 5} 1/8  {7, −27, −20, 54,−19, 5} 3/16 {6, −21, −29, 57, −18, 5} 1/4  {4, −17, −36, 60, −15, 4}5/16 {3, −9, −44, 61, −15, 4} 3/8  {1, −4, −48, 61, −13, 3} 7/16 {0, 1,−54, 60, −9, 2} 1/2  {−1, 4, −57, 57, −4, 1}

TABLE 2 Exemplary interpolation filters for prediction signal generationin BIO Fractional pel position Interpolation filter for predictionsignal(BIOfilterS) 0 {0, 0, 64, 0, 0, 0} 1/16 {1, −3, 64, 4, −2, 0} 1/8 {1, −6, 62, 9, −3, 1} 3/16 {2, −8, 60, 14, −5, 1} 1/4  {2, −9, 57, 19,−7, 2} 5/16 {3, −10, 53, 24, −8, 2} 3/8  {3, −11, 50, 29, −9, 2} 7/16{3, −11, 44, 35, −10, 3} 1/2  {3, −10, 35, 44, −11, 3}

In the JEM, BIO can be applied to all bi-predicted blocks when the twopredictions are from different reference pictures. When LocalIllumination Compensation (LIC) is enabled for a CU, BIO can bedisabled.

In some embodiments, OBMC is applied for a block after normal MCprocess. To reduce the computational complexity, BIO may not be appliedduring the OBMC process. This means that BIO is applied in the MCprocess for a block when using its own MV and is not applied in the MCprocess when the MV of a neighboring block is used during the OBMCprocess.

2.15 Examples of Decoder-Side Motion Vector Refinement (DMVR)

In a bi-prediction operation, for the prediction of one block region,two prediction blocks, formed using a motion vector (MV) of list0 and aMV of list1, respectively, are combined to form a single predictionsignal. In the decoder-side motion vector refinement (DMVR) method, thetwo motion vectors of the bi-prediction are further refined by abilateral template matching process. The bilateral template matchingapplied in the decoder to perform a distortion-based search between abilateral template and the reconstruction samples in the referencepictures in order to obtain a refined MV without transmission ofadditional motion information.

In DMVR, a bilateral template is generated as the weighted combination(i.e. average) of the two prediction blocks, from the initial MV0 oflist0 and MV1 of list1, respectively, as shown in FIG. 26. The templatematching operation consists of calculating cost measures between thegenerated template and the sample region (around the initial predictionblock) in the reference picture. For each of the two reference pictures,the MV that yields the minimum template cost is considered as theupdated MV of that list to replace the original one. In the JEM, nine MVcandidates are searched for each list. The nine MV candidates includethe original MV and 8 surrounding MVs with one luma sample offset to theoriginal MV in either the horizontal or vertical direction, or both.Finally, the two new MVs, i.e., MV0′ and MV1′ as shown in FIG. 26, areused for generating the final bi-prediction results. A sum of absolutedifferences (SAD) is used as the cost measure.

DMVR is applied for the merge mode of bi-prediction with one MV from areference picture in the past and another from a reference picture inthe future, without the transmission of additional syntax elements. Inthe JEM, when LIC, affine motion, FRUC, or sub-CU merge candidate isenabled for a CU, DMVR is not applied.

3. Exemplary Embodiments Related to the Disclosed Technology

The embodiments described in PCT/CN2018/109425 (incorporated byreference herein in its entirety), for example, include an MV updatemethod and a two-step inter prediction method. The derived MV betweenreference block 0 and reference block 1 in BIO are scaled and added tothe original motion vector of list 0 and list 1. Meanwhile, the updatedMV is used to perform motion compensation and a second inter predictionis generated as the final prediction. Other embodiments includemodifying the temporal gradient by removing the mean difference betweenreference block 0 and reference block 1. In yet other embodiments, theMV update method and the two-step inter prediction method are extendedto be performed multiple times.

4. Drawbacks of Existing Implementations

In some existing implementations, how to apply BIO or/and DMVR or anyother decoder side motion vector derivation/refinement tools to CUscoded with multi-hypothesis prediction mode or GBI mode is not welldefined.

In other existing implementations that use generalized bi-prediction(GBI), when encoding the weighting factor index (e.g., the GBI index),all bins are coded with context, which is computationally complex.

5. Example Methods for Harmonization of DMVD Tools with Other Tools

Embodiments of the presently disclosed technology overcome the drawbacksof existing implementations, thereby providing video coding with highercoding efficiencies. The harmonization of DMVD tools with other videocoding tools, based on the disclosed technology, may enhance bothexisting and future video coding standards, is elucidated in thefollowing examples described for various implementations. The examplesof the disclosed technology provided below explain general concepts, andare not meant to be interpreted as limiting. In an example, unlessexplicitly indicated to the contrary, the various features described inthese examples may be combined.

The disclosed technology describes how to apply BIO or/and DMVR or anyother decoder side motion vector derivation/refinement tools to blockscoded with multi-hypothesis prediction mode or GBI mode. Hereinafter,DMVD (decoder side motion vector derivation) is used to represent BIOor/and DMVR or/and FRUC or/and any other decoder side motion vectorderivation/refinement technologies. In addition, extensions of DMVDtechnologies to other coding methods are also proposed in this document.

The examples described above may be incorporated in the context of themethod described below, e.g., methods 2700 and 2750, which may beimplemented at a video decoder or a video encoder.

Example 1

It is proposed that DMVD may be performed for blocks coded withmulti-hypothesis prediction modes (e.g., as described in Sections 2.9,2.10 and 2.11).

(a) In one example, for a uni-predicted block with multi-hypothesis, ifit is predicted with two reference blocks from different predictiondirections, DMVD may be performed.

(b) In one example, if a block is predicted with three reference blocks,DMVD may be performed by selecting two of the reference blocks. Let'sdenoted the three reference blocks as ref0, ref1 and ref2, suppose ref0is from prediction direction X and ref1 and ref2 are from predictiondirection 1-X, DMVD may be performed for the reference block pair (ref0,ref1) or/and (ref0, ref2).

-   -   (i) In one example, DMVD may be only performed once. In this        case, either (ref0, ref1) or (ref0, ref2) may be utilized in the        DMVD process.    -   (ii) Alternatively, DMVD may be performed twice. In this case,        (ref0, ref1) and (ref0, ref2) may be utilized in the 1^(st) and        2^(nd) DMVD process, respectively. Alternatively, (ref0, ref2)        and (ref0, ref1) may be utilized in the 1^(st) and 2^(nd) DMVD        process, respectively.        -   (1) In one example, the refined information (e.g., refined            motion information due to BIO or DMVR) of the one DMVD            process (e.g., 1^(st) DMVD) may be used as inputs to another            DMVD process (e.g., 2^(nd) DMVD). That is, sequential            processes of the two DMVD processes may be applied            (sequential mode).        -   (2) Alternatively, the multiple DMVD processes may be            invoked with the same inputs such that the multiple            processes could be done in parallel (parallel mode).    -   (iii) In one example, if ref0 is refined twice by BIO, denoted        as ref0_r1 and ref0_r2, then ref0_r1 and ref0_r2 may be used        jointly (e.g., averaged or weighted averaged) to generate the        final refined value of ref0. For example,        ref0′=(ref0_r1+ref0_r2+1)>>1 is used as the refined ref0.        Alternatively, either ref0_r1 or ref0_r2 is used as the refined        ref0.    -   (iv) In one example, if motion information (denoted as MV0) of        ref0 is refined twice by BIO or DMVR, denoted as MV0_r1 and        MV0_r2, then MV0_r1 and MV0_r2 may be used jointly (e.g.,        averaged or weighted averaged) to generate the final refined        values of MV0. For example, MV0′=(MV0_r1+MV0_r2+1)>>1 is used as        the refined MV0. Alternatively, either MV0_r1 or MV0_r2 is used        as the refined MV0.

(c) In one example, if a block is predicted with N reference blocks, andM reference blocks are from prediction direction X and N−M referenceblocks are from prediction direction 1−X, DMVD may be performed for anyof /some of two reference blocks wherein one is from predictiondirection X and another is from prediction direction 1−X.

-   -   (i) Similar to (b)(ii), multiple times of DMVD processes may be        invoked either in parallel mode or sequential mode.    -   (ii) In one example, if a reference block is refined T times by        BIO, then partial or all of these T refined values may be        jointly used to derive the final refined value of the reference        block (e.g., using average or weighted average).    -   (iii) Alternatively, if a reference block is refined T times by        BIO, then partial or all of PT refined values may be jointly        used to derive the final refined value of the reference block        (e.g., using average or weighted average). For example, PT is        equal to 1, 2, 3, 4, . . . , T−1.    -   (iv) In one example, if motion information of a reference block        is refined T times by e.g., BIO or DMVR, then partial or all of        these T refined MVs may be jointly used to derive the final        refined MV of the reference block (e.g., using average or        weighted average).    -   (v) Alternatively, if motion information of a reference block is        refined T times by e.g., BIO or DMVR, then partial or all of PT        refined MVs may be jointly used (e.g., using average or weighted        average) to derive the final refined values of the reference        block. For example, PT is equal to 1, 2, 3, 4, . . . , T−1.

(d) In one example, if a block is predicted with multiple sets of motioninformation (for example, one set of motion information is from AMVPmode and another set of motion information is from merge candidate(e.g., as described in Section 2.10) or both sets of motion informationare from merge candidates (e.g., as described in Section 2.11)), DMVDmay be performed for each/some set of motion information.

-   -   (i) In one example, DMVD is invoked when the motion information        is bi-directional motion information.    -   (ii) In one example, in multi-hypothesis inter prediction mode        (as described in Section 2.9), DMVD is only performed for        non-additional motion information.

(e) In one example, DMVD may be performed at most once.

-   -   (i) For example, if a block is coded with multi-hypothesis        merge/skip mode (e.g., as described in Section 2.11), DMVD is        performed only for the 1^(st) selected merge candidate.        -   (1) Alternatively, DMVD is performed only for the 2^(nd)            selected merge candidate.        -   (2) Alternatively, the two/N selected merge candidates are            checked in order, and DMVD is only performed for the first            available bi-directional merge candidate.    -   (ii) For example, if a block is coded with multi-hypothesis AMVP        mode (as described in Section 2.10), DMVD is performed only for        the merge candidate.    -   (iii) For example, if a block is coded with multi-hypothesis        inter prediction mode (e.g., as described in Section 2.9), the        first available reference block from List 0 and List 1 (if there        is any) are identified according to the signaling order of the        corresponding syntax elements, and DMVD is performed only for        these two reference blocks.

Example 2

It is proposed that when asymmetric weighting factors are used forbi-directional prediction (like GBI, LIC etc.) or multi-hypothesisprediction, such weighting factors may be used in DMVD process.

(a) In one example, before calculating temporal gradients or/and spatialgradients in BIO, each reference block may be scaled by itscorresponding weighting factor.

(b) In one example, when performing the bi-lateral matching or templatematching in DMVR, each reference block may be scaled by itscorresponding weighting factor.

(c) In one example, if template matching is used in DMVR, such weightingfactors may be used when generating the template.

Example 3

It is proposed that DMVD may be used in AMVP mode when all MVDcomponents are zero. Alternatively, if MVD component is zero inprediction direction X and is non-zero in prediction direction 1−X, DMVDmay be used to refine motion vector in prediction direction X. In oneexample, in DMVR, prediction signal in list 1−X is used as a template tofind the best motion vector in list X.

Example 4

It is proposed that DMVD may be used to refine the translational motionparameters in bi-directional affine mode or UMVE affine mode.

(a) Alternatively, in bi-directional affine inter mode, DMVD is used torefine the translational motion parameters only when MVD of thetranslational motion parameters are all zero.

(b) Alternatively, in UMVE affine mode, DMVD is used to refine thetranslational motion parameters only when MVD of the translationalmotion parameters are all zero.

Example 5

It is proposed that DMVD may be enabled in UMVE mode.

(a) Alternatively, DMVD is disabled when there is non-zero MVD componentin UMVE mode.

(b) Alternatively, DMVD is disabled in UMVE mode.

Example 6

It is proposed that whether to enable DMVD may be depend on the decodedmotion information

-   -   a. It is proposed that DMVD may be enabled when absolute value        (denoted as ABS(MV) of MV and/or MVD and/or decoded motion        vector (denoted as (MV_x, MV_y)) of a block is less than a        threshold TH1, wherein TH1>=0.        -   i. ABS(MV) may be defined as            -   1. ABS(MV)=abs(MV_x)            -   2. ABS(MV)=abs(MV_y)            -   3. ABS(MV)=f(abs(MV_x), abs(MV_y)), where f is a                function.                -   a. ABS(MV)=min(abs(MV_x), abs(MV_y));                -   b. ABS(MV)=max(abs(MV_x), abs(MV_y));                -   c. ABS(MV)=abs(MV_x)+abs(MV_y);                -   d. ABS(MV)=(abs(MV_x)+abs(MV_y))/2;        -   ii. In one example, if ABS(MV) of a block is less than TH1            in any prediction direction, DMVD may be enabled.        -   iii. In one example, if ABS(MV) of a block is less than TH1            in both prediction directions, DMVD may be enabled.        -   iv. In one example, it is required both components            (horizontal/vertical) of the absolute MV and/or absolute MVD            are less than a threshold. Alternatively, two thresholds are            used, one for horizontal component and the other one for            vertical component. it is required the horizontal component            is less than the first threshold and the vertical component            is less than the second threshold.        -   v. In one example, it is required either the horizontal            component is less than the first threshold or the vertical            component is less than the second threshold.        -   vi. In some example, the first and the second thresholds are            the same.        -   vii. In one example, such method may be not applied to            non-UMVE merge mode.        -   viii. In one example, such method may be not applied to UMVE            mode.        -   ix. In one example, such method may be not applied to AMVP            mode.        -   x. The MV or MVD mentioned above may be derived from the            AMVP mode, or it may be derived from UMVE (a.k.a MMVD) mode.    -   b. It is proposed that DMVD may be enabled when absolute value        (denoted as ABS(MV) of MV and/or MVD and/or decoded motion        vector (denoted as (MV_x, MV_y)) of a block is greater than a        threshold TH2, wherein TH2>=0.        -   i. ABS(MV) may be defined as            -   1. ABS(MV)=abs(MV_x)            -   2. ABS(MV)=abs(MV_y)            -   3. ABS(MV)=f(abs(MV_x), abs(MV_y)), where f is a                function.                -   a. ABS(MV)=min(abs(MV_x), abs(MV_y));                -   b. ABS(MV)=max(abs(MV_x), abs(MV_y));                -   c. ABS(MV)=abs(MV_x)+abs(MV_y);                -   d. ABS(MV)=(abs(MV_x)+abs(MV_y))/2;        -   ii. In one example, if ABS(MV) of a block is greater than            TH2 in any prediction direction, DMVD may be disabled.        -   iii. In one example, if ABS(MV) of a block is greater than            TH2 in both prediction directions, DMVD may be disabled.        -   iv. In one example, it is required both components            (horizontal/vertical) of the absolute MV and/or absolute MVD            are larger than a threshold. Alternatively, two thresholds            are used, one for horizontal component and the other one for            vertical component. it is required the horizontal component            is larger than the first threshold and the vertical            component is larger than the second threshold.        -   v. In one example, it is required either the horizontal            component is larger than the first threshold or the vertical            component is larger than the second threshold.        -   vi. In some example, the first and the second thresholds are            the same.        -   vii. In one example, such method may be not applied to            non-UMVE merge mode.        -   viii. In one example, such method may be not applied to UMVE            mode.        -   ix. In one example, such method may be not applied to AMVP            mode.        -   x. The MV or MVD mentioned above may be derived from the            AMVP mode, or it may be derived from UMVE (a.k.a MMVD) mode.    -   c. When a block is coded with bi-prediction, only motion        information of one reference picture list may be utilized.        -   i. Alternatively, motion information of both reference            picture lists may be used. In one example, the MVs (or MVDs)            are the max/min/averaged MV (or MVD) of two reference            picture list.        -   d. It is proposed for the bi-prediction case, whether to            enable or disable DMVD, it may depend on the distance of two            motion vectors of each reference picture list.        -   e. Determination of enabling/disabling DMVD may be            controlled separately for each reference picture list.

Example 7

It is proposed that DMVD may be applied under certain conditions, suchas based on block sizes, encoding mode, motion information,slice/picture/tile types.

(a) In one example, when a block size contains less than M*H samples,e.g., 16 or 32 or 64 luma samples, DMVD is not allowed.

(b) In one example, when a block size contains more than M*H samples,e.g., 16 or 32 or 64 luma samples, DMVD is not allowed.

(c) Alternatively, when minimum size of a block's width or height issmaller than or no larger than X, DMVD is not allowed. In one example, Xis set to 8.

(d) Alternatively, when a block's width >th1 or >th1 and/or a block'sheight>th2 or >th2, DMVD is not allowed. In one example, X is set to 64.

-   -   (i) For example, DMVD is disabled for 128×128 block.    -   (ii) For example, DMVD is disabled for N×128/128×N block, for        N>64.    -   (iii) For example, DMVD is disabled for N×128/128×N block, for        N>4.

(e) Alternatively, when a block's width<th1 or <th1 and/or a block'sheight<th2 or <th2, DMVD is not allowed. In one example th1 or th2 isset to 8.

(f) In one example, DMVD is disabled for blocks coded in AMVP mode.

(g) In one example, DMVD is disabled for blocks coded in skip mode.

(h) In one example, DMVD is disabled for the block if GBI is used.

(i) In one example, DMVD is disabled for a block if multi-hypothesisinter prediction (as described in Sections 2.9, 2.10 and 2.11) is used,e.g., if the CU is predicted from more than 2 reference blocks.

(j) In one example, DMVD is disabled for the block/sub-block whenabsolute mean difference of the two reference blocks/sub-blocks islarger than a threshold.

Example 8

It is proposed that DMVD may be applied in a sub-block level.

(a) In one example, DMVD may be invoked for each sub-block.

(b) In one example, when a block with either width or height or bothwidth and height are both larger than (or equal to) a threshold L, theblock may be split into multiple sub-blocks. Each sub-block is treatedin the same way as a normal coding block with size equal to thesub-block size.

-   -   (i) In one example, L is 64, a 64×128/128×64 block is split into        two 64×64 sub-blocks, and a 128×128 block is split into four        64×64 sub-blocks. However, N×128/128×N block, wherein N<64, is        not split into sub-blocks.    -   (ii) In one example, L is 64, a 64×128/128×64 block is split        into two 64×64 sub-blocks, and a 128×128 block is split into        four 64×64 sub-blocks. Meanwhile, N×128/128×N block, wherein        N<64, is split into two N×64/64×N sub-blocks.

(c) The threshold L may be pre-defined or signaled inSPS/PPS/picture/slice/tile group/tile level.

(d) Alternatively, the thresholds may depend on certain codedinformation, such as block size, picture type, temporal layer index,etc.

Example 9

In one example, whether to and how to apply the above methods (e.g.,motion refinement methods such as DMVR or/and BIO and/or other decoderside motion refinement technologies) depends on the reference picture.

(a) In one example, motion refinement methods are not applied if thereference picture is the current coding picture.

(b) In one example, multi-time motion refinement methods claimed inprevious bullets are not applied if the reference picture is the currentcoding picture.

Example 10

The above methods as well as the existing DMVD methods (e.g., BIO/DMVR)may be also applied even two reference blocks/reference pictures arefrom the same reference picture list.

(a) Alternatively, furthermore, when two reference blocks are from samereference picture list, it is required that the two reference picturesare crossing the current picture covering current block. That is, onereference picture has a smaller POC value and the other has a larger POCvalue compared to POC of the current picture.

(b) In one example, the condition check of the prediction direction isbi-prediction for enabling/disabling BIO is removed. That is, whetherBIO or DMVD is enabled or not is independent from the predictiondirection value.

(c) When product of the POC differences between current picture and itstwo reference pictures (either from same reference picture list, ordifferent reference picture lists) is smaller than 0, BIO or DMVD may beenabled.

(d) When product of the POC differences between current picture and itstwo reference pictures (either from same reference picture list, ordifferent reference picture lists) is smaller than or equal to 0 (e.g.,one or two reference picture is the current picture), BIO or DMVD may beenabled.

Example 11

It is proposed that when encoding the GBI index, some bins are bypasscoded. Denote the maximum length of the code bins of GBI index asmaxGBIIdxLen.

(a) In one example, only the first bin is coded with context and allother bins are bypass coded.

-   -   (i) In one example, one context is used for encoding the first        bin.    -   (ii) In one example, more than 1 contexts are used for encoding        the first bin. For example, 3 contexts are used as follows:        -   (1) ctxIdx=aboveBlockIsGBIMode+leftBlockIsGBIMode;        -   (2) aboveBlockIsGBIMode equals to 1 if the above neighboring            block is coded in GBI mode, otherwise it equals to 0; and        -   (3) leftBlockIsGBIMode equals to 1 if the left neighboring            block is coded in GBI mode, otherwise it equals to 0.

(b) In one example, only the first K bins are coded with contexts andall other bins are bypass coded, wherein 0=<K<=maxGBIIdxLen.

-   -   (i) In one example, one context is shared for all context coded        bins except the first bin.    -   (ii) In one example, one context is used for each context coded        bin except the first bin.

FIG. 27A shows a flowchart of an exemplary method for video processing.The method 2700 includes, at operation 2702, making a decision, for aconversion between a current block of a video and a bitstreamrepresentation of the video, regarding a selective enablement of adecoder side motion vector derivation (DMVD) tool for the current block,the DMVD tool deriving a refinement of motion information signaled inthe bitstream representation, and the conversion using a merge mode andmotion vector differences that are indicated by a motion direction and amotion magnitude.

The method 2700 includes, at operation 2704, performing, based on thedecision, a conversion between the current block and the bitstreamrepresentation.

FIG. 27B shows a flowchart of an exemplary method for video processing.The method 2750 includes, at operation 2752, making a decision, based ondecoded motion information associated with a current block of a video,regarding a selective enablement of a decoder side motion vectorderivation (DMVD) tool for the current block, the DMVD tool deriving arefinement of motion information signaled in a bitstream representationof the video.

The method 2750 includes, at operation 2754, performing, based on thedecision, a conversion between the current block and the bitstreamrepresentation.

In some embodiments, the following technical solutions may beimplemented:

1. A method (e.g., method 2700 in FIG. 27A) for video processing,comprising: making (2702) a decision, for a conversion between a currentblock of a video and a bitstream representation of the video, regardinga selective enablement of a decoder side motion vector derivation (DMVD)tool for the current block, wherein the DMVD tool derives a refinementof motion information signaled in the bitstream representation, andwherein the conversion uses a merge mode and motion vector differencesthat are indicated by a motion direction and a motion magnitude; andperforming (2704), based on the decision, a conversion between thecurrent block and the bitstream representation. For example, in somecases, the decision may be to enable DMVD, in which case encoding ordecoding of the current block is performed using DMVD. In some cases,the decision may be to disable (or not use) DMVD, in which case theencoding or the decoding may be performed without using the DMVD tool.

2. The method of solution 1, wherein the DMVD tool is enabled.

3. The method of solution 1, wherein the DMVD tool is disabled.

4. The method of solution 1, wherein the DMVD tool is disabled upon adetermination that the current block is coded using the merge mode.

5. The method of any of solutions 1 to 4, wherein the merge mode furthercomprises a starting point of motion information indicated by a mergeindex, and wherein a final motion information of the current block isbased on the motion vector differences and the starting point.

6. The method of solution 1, wherein the DMVD tool is disabled upon adetermination that the merge mode comprises a non-zero motion vectordifference (MVD) component.

7. A method (e.g., method 2750 in FIG. 27B) for video processing,comprising: making (2752) a decision, based on decoded motioninformation associated with a current block of a video, regarding aselective enablement of a decoder side motion vector derivation (DMVD)tool for the current block, wherein the DMVD tool derives a refinementof motion information signaled in a bitstream representation of thevideo; and performing (2754), based on the decision, a conversionbetween the current block and the bitstream representation.

8. The method of solution 7, wherein the DMVD tool is enabled upon adetermination that (1) an absolute value of motion vector, or (2) anabsolute value of a motion vector difference, or (3) an absolute valueof a decoded motion vector of the current block is (a) less than athreshold TH1, wherein TH1≥0, or (b) greater than a threshold TH2,wherein TH2≥0.

9. The method of solution 7, wherein the DMVD tool is enabled upon adetermination that an absolute value of a decoded motion vector of thecurrent block in a horizontal or vertical prediction direction is (a)less than a threshold THh1 or THv1, respectively, wherein THh1≥0 andTHv1≥0, or (b) greater than a threshold THh2 or THv2, respectively,wherein THh2≥0 and THv2≥0.

10. The method of solution 8 or 9, wherein the current block is codedusing a bi-prediction mode, and wherein the decision is further based onmotion information from only one reference picture list associated withthe current block.

11. The method of solution 8 or 9, wherein the current block is codedusing a bi-prediction mode, and wherein the decision is based on motioninformation from both reference picture lists associated with thecurrent block.

12. The method of any of solutions 7 to 9, wherein the DMVD tool isenabled upon a determination that the current block is not encoded usinga specific encoding mode.

13. The method of solution 12, wherein the specific encoding modeincludes an ultimate motion vector expression (UMVE) mode or an advancedmotion vector prediction (AMVP) mode.

14. The method of solution 12, wherein the specific encoding modeexcludes a bi-prediction mode and includes a condition in which adistance between two motion vectors of each reference picture list forthe current block is greater than or less than a predetermined value.

15. The method of solution 7, wherein the DMVD tool is enabled upon adetermination that a function of an absolute value of a decoded motionvector (MV) of the current block in a horizontal prediction direction(MV_x) and a vertical prediction direction (MV_y) is (a) less than athreshold TH1, wherein TH1≥0, or (b) greater than a threshold TH2,wherein TH2≥0.

16. The method of solution 15, wherein the function is one of:f(abs(MV))=min(abs(MV_x), abs(MV_y)), or f(abs(MV))=max(abs(MV_x),abs(MV_y)), or f(abs(MV))=(abs(MV_x)+abs(MV_y)), orf(abs(MV))=(abs(MV_x)+abs(MV_y))/2.

17. The method of any of solutions 1 to 16, wherein the DMVD toolcomprises at least one of a bi-directional optical flow (BIO) algorithm,a decoder-side motion vector refinement (DMVR) algorithm or a frame-rateup conversion (FRUC) algorithm.

18. The method of any of solutions 1 to 17, wherein the conversiongenerates the current block from the bitstream representation.

19. The method of any of solutions 1 to 17, wherein the conversiongenerates the bitstream representation from the current block.

20. An apparatus in a video system comprising a processor and anon-transitory memory with instructions thereon, wherein theinstructions upon execution by the processor, cause the processor toimplement the method in any one of solutions 1 to 19.

21. A computer program product stored on a non-transitory computerreadable media, the computer program product including program code forcarrying out the method in any one of solutions 1 to 19.

6. Example Implementations of the Disclosed Technology

FIG. 28 is a block diagram of a video processing apparatus 2800. Theapparatus 2800 may be used to implement one or more of the methodsdescribed herein. The apparatus 2800 may be embodied in a smartphone,tablet, computer, Internet of Things (IoT) receiver, and so on. Theapparatus 2800 may include one or more processors 2802, one or morememories 2804 and video processing hardware 2806. The processor(s) 2802may be configured to implement one or more methods (including, but notlimited to, method 2700) described in the present document. The memory(memories) 2804 may be used for storing data and code used forimplementing the methods and techniques described herein. The videoprocessing hardware 2806 may be used to implement, in hardwarecircuitry, some techniques described in the present document.

In some embodiments, the video coding methods may be implemented usingan apparatus that is implemented on a hardware platform as describedwith respect to FIG. 28.

Some embodiments of the disclosed technology include making a decisionor determination to enable a video processing tool or mode. In anexample, when the video processing tool or mode is enabled, the encoderwill use or implement the tool or mode in the processing of a block ofvideo, but may not necessarily modify the resulting bitstream based onthe usage of the tool or mode. That is, a conversion from the block ofvideo to the bitstream representation of the video will use the videoprocessing tool or mode when it is enabled based on the decision ordetermination. In another example, when the video processing tool ormode is enabled, the decoder will process the bitstream with theknowledge that the bitstream has been modified based on the videoprocessing tool or mode. That is, a conversion from the bitstreamrepresentation of the video to the block of video will be performedusing the video processing tool or mode that was enabled based on thedecision or determination.

Some embodiments of the disclosed technology include making a decisionor determination to disable a video processing tool or mode. In anexample, when the video processing tool or mode is disabled, the encoderwill not use the tool or mode in the conversion of the block of video tothe bitstream representation of the video. In another example, when thevideo processing tool or mode is disabled, the decoder will process thebitstream with the knowledge that the bitstream has not been modifiedusing the video processing tool or mode that was enabled based on thedecision or determination.

FIG. 29 is a block diagram showing an example video processing system2900 in which various techniques disclosed herein may be implemented.Various implementations may include some or all of the components of thesystem 2900. The system 2900 may include input 2902 for receiving videocontent. The video content may be received in a raw or uncompressedformat, e.g., 8 or 10 bit multi-component pixel values, or may be in acompressed or encoded format. The input 2902 may represent a networkinterface, a peripheral bus interface, or a storage interface. Examplesof network interface include wired interfaces such as Ethernet, passiveoptical network (PON), etc. and wireless interfaces such as Wi-Fi orcellular interfaces.

The system 2900 may include a coding component 2904 that may implementthe various coding or encoding methods described in the presentdocument. The coding component 2904 may reduce the average bitrate ofvideo from the input 2902 to the output of the coding component 2904 toproduce a coded representation of the video. The coding techniques aretherefore sometimes called video compression or video transcodingtechniques. The output of the coding component 2904 may be eitherstored, or transmitted via a communication connected, as represented bythe component 2906. The stored or communicated bitstream (or coded)representation of the video received at the input 2902 may be used bythe component 2908 for generating pixel values or displayable video thatis sent to a display interface 2910. The process of generatinguser-viewable video from the bitstream representation is sometimescalled video decompression. Furthermore, while certain video processingoperations are referred to as “coding” operations or tools, it will beappreciated that the coding tools or operations are used at an encoderand corresponding decoding tools or operations that reverse the resultsof the coding will be performed by a decoder.

Examples of a peripheral bus interface or a display interface mayinclude universal serial bus (USB) or high definition multimediainterface (HDMI) or Displayport, and so on. Examples of storageinterfaces include SATA (serial advanced technology attachment), PCI,IDE interface, and the like. The techniques described in the presentdocument may be embodied in various electronic devices such as mobilephones, laptops, smartphones or other devices that are capable ofperforming digital data processing and/or video display.

From the foregoing, it will be appreciated that specific embodiments ofthe presently disclosed technology have been described herein forpurposes of illustration, but that various modifications may be madewithout deviating from the scope of the invention. Accordingly, thepresently disclosed technology is not limited except as by the appendedclaims.

Implementations of the subject matter and the functional operationsdescribed in this patent document can be implemented in various systems,digital electronic circuitry, or in computer software, firmware, orhardware, including the structures disclosed in this specification andtheir structural equivalents, or in combinations of one or more of them.Implementations of the subject matter described in this specificationcan be implemented as one or more computer program products, i.e., oneor more modules of computer program instructions encoded on a tangibleand non-transitory computer readable medium for execution by, or tocontrol the operation of, data processing apparatus. The computerreadable medium can be a machine-readable storage device, amachine-readable storage substrate, a memory device, a composition ofmatter effecting a machine-readable propagated signal, or a combinationof one or more of them. The term “data processing unit” or “dataprocessing apparatus” encompasses all apparatus, devices, and machinesfor processing data, including by way of example a programmableprocessor, a computer, or multiple processors or computers. Theapparatus can include, in addition to hardware, code that creates anexecution environment for the computer program in question, e.g., codethat constitutes processor firmware, a protocol stack, a databasemanagement system, an operating system, or a combination of one or moreof them.

A computer program (also known as a program, software, softwareapplication, script, or code) can be written in any form of programminglanguage, including compiled or interpreted languages, and it can bedeployed in any form, including as a stand-alone program or as a module,component, subroutine, or other unit suitable for use in a computingenvironment. A computer program does not necessarily correspond to afile in a file system. A program can be stored in a portion of a filethat holds other programs or data (e.g., one or more scripts stored in amarkup language document), in a single file dedicated to the program inquestion, or in multiple coordinated files (e.g., files that store oneor more modules, sub programs, or portions of code). A computer programcan be deployed to be executed on one computer or on multiple computersthat are located at one site or distributed across multiple sites andinterconnected by a communication network.

The processes and logic flows described in this specification can beperformed by one or more programmable processors executing one or morecomputer programs to perform functions by operating on input data andgenerating output. The processes and logic flows can also be performedby, and apparatus can also be implemented as, special purpose logiccircuitry, e.g., an FPGA (field programmable gate array) or an ASIC(application specific integrated circuit).

Processors suitable for the execution of a computer program include, byway of example, both general and special purpose microprocessors, andany one or more processors of any kind of digital computer. Generally, aprocessor will receive instructions and data from a read only memory ora random access memory or both. The essential elements of a computer area processor for performing instructions and one or more memory devicesfor storing instructions and data. Generally, a computer will alsoinclude, or be operatively coupled to receive data from or transfer datato, or both, one or more mass storage devices for storing data, e.g.,magnetic, magneto optical disks, or optical disks. However, a computerneed not have such devices. Computer readable media suitable for storingcomputer program instructions and data include all forms of nonvolatilememory, media and memory devices, including by way of examplesemiconductor memory devices, e.g., EPROM, EEPROM, and flash memorydevices. The processor and the memory can be supplemented by, orincorporated in, special purpose logic circuitry.

It is intended that the specification, together with the drawings, beconsidered exemplary only, where exemplary means an example. As usedherein, the use of “or” is intended to include “and/or”, unless thecontext clearly indicates otherwise.

While this patent document contains many specifics, these should not beconstrued as limitations on the scope of any invention or of what may beclaimed, but rather as descriptions of features that may be specific toparticular embodiments of particular inventions. Certain features thatare described in this patent document in the context of separateembodiments can also be implemented in combination in a singleembodiment. Conversely, various features that are described in thecontext of a single embodiment can also be implemented in multipleembodiments separately or in any suitable subcombination. Moreover,although features may be described above as acting in certaincombinations and even initially claimed as such, one or more featuresfrom a claimed combination can in some cases be excised from thecombination, and the claimed combination may be directed to asubcombination or variation of a subcombination.

Similarly, while operations are depicted in the drawings in a particularorder, this should not be understood as requiring that such operationsbe performed in the particular order shown or in sequential order, orthat all illustrated operations be performed, to achieve desirableresults. Moreover, the separation of various system components in theembodiments described in this patent document should not be understoodas requiring such separation in all embodiments.

Only a few implementations and examples are described and otherimplementations, enhancements and variations can be made based on whatis described and illustrated in this patent document.

What is claimed is:
 1. A method for video processing, comprising: makinga decision, for a conversion between a current block of a video and abitstream representation of the video, regarding whether a decoder sidemotion vector derivation (DMVD) tool for the current block is enabledbased on whether a coding mode is enabled for the conversion; whereinthe DMVD tool derives a refinement of motion information, and the codingmode comprises at least one of a merge mode with a motion vectordifference that is indicated by a motion direction and a motionmagnitude, or a motion vector prediction mode in which a motion vectoris acquired based on a motion vector predictor; and performing, based onthe decision, a conversion between the current block and the bitstreamrepresentation.
 2. The method of claim 1, wherein the conversiongenerates the current block from the bitstream representation.
 3. Themethod of claim 1, wherein the conversion generates the bitstreamrepresentation from the current block.
 4. The method of claim 1, whereinthe DMVD tool comprises at least one of a bi-directional optical flowalgorithm, a decoder-side motion vector refinement algorithm or aframe-rate up conversion algorithm.
 5. The method of claim 1, whereinthe DMVD tool is disabled if the current block is coded using the mergemode with the motion vector difference.
 6. The method of claim 1,wherein the merge mode with the motion vector difference furthercomprises a starting point of motion information indicated by a mergeindex, and wherein a final motion information of the current block isbased on the motion vector difference and the starting point.
 7. Themethod of claim 1, wherein the merge mode with the motion vectordifference indicates that the motion vector difference comprises anon-zero motion vector difference (MVD) component.
 8. The method ofclaim 1, wherein the DMVD tool is disabled if the current block is codedusing the motion vector prediction mode.
 9. The method of claim 1,wherein the motion vector prediction mode is an Advance motion vectorpredictor (AMVP) mode.
 10. The method of claim 1, wherein whether theDMVD tool for the current block is enabled is further based on whether ageneralized bi-prediction (GBI) mode is enabled, wherein the GBI modeindicates that different weights in a Coding Unit level are applied tothe two prediction blocks generated from a reference picture list 0 anda reference picture list 1 to derive a final prediction block of thecurrent block.
 11. The method of claim 1, wherein the DMVD tool isdisabled if the current block is coded using the GBI mode.
 12. Themethod of claim 1, wherein whether the DMVD tool is enabled is furtherbased on motion information of the current video block.
 13. The methodof claim 12, wherein the DMVD tool is enabled upon a determination that(1) an absolute value of a motion vector, or (2) an absolute value of amotion vector difference, or (3) an absolute value of a motion vector ofthe current block is (a) less than a threshold TH1, wherein TH1≥0, or(b) greater than a threshold TH2, wherein TH2≥0.
 14. The method of claim12, wherein the DMVD tool is enabled upon a determination that anabsolute value of a decoded motion vector of the current block in ahorizontal or vertical prediction direction is (a) less than a thresholdTHh1 or THv1, respectively, wherein THh1≥0 and THv1≥0, or (b) greaterthan a threshold THh2 or THv2, respectively, wherein THh2≥0 and THv2≥0.15. The method of claim 12, wherein the DMVD tool is enabled upon adetermination that a function of an absolute value of a decoded motionvector (MV) of the current block in a horizontal prediction direction(MV_x) and a vertical prediction direction (MV_y) is (a) less than athreshold TH1, wherein TH1≥0, or (b) greater than a threshold TH2,wherein TH2≥0.
 16. The method of claim 12, wherein the current block iscoded using a bi-prediction mode, and wherein the decision is furtherbased on the motion information from only one reference picture listassociated with the current block.
 17. The method of claim 12, whereinthe current block is coded using a bi-prediction mode, and wherein thedecision is further based on the motion information from both referencepicture lists associated with the current block.
 18. An apparatus forprocessing video data comprising a processor and a non-transitory memorywith instructions thereon, wherein the instructions upon execution bythe processor, cause the processor to: make a decision, for a conversionbetween a current block of a video and a bitstream representation of thevideo, regarding whether a decoder side motion vector derivation (DMVD)tool for the current block is enabled based on whether a coding mode isenabled for the conversion; wherein the DMVD tool derives a refinementof motion information, and the coding mode comprises at least one of amerge mode with a motion vector difference that is indicated by a motiondirection and a motion magnitude, or a motion vector prediction mode inwhich a motion vector is acquired based on a motion vector predictor;and perform, based on the decision, a conversion between the currentblock and the bitstream representation.
 19. A non-transitorycomputer-readable storage medium storing instructions that cause aprocessor to: make a decision, for a conversion between a current blockof a video and a bitstream representation of the video, regardingwhether a decoder side motion vector derivation (DMVD) tool for thecurrent block is enabled based on whether a coding mode is enabled forthe conversion; wherein the DMVD tool derives a refinement of motioninformation, and the coding mode comprises at least one of a merge modewith a motion vector difference that is indicated by a motion directionand a motion magnitude, or a motion vector prediction mode in which amotion vector is acquired based on a motion vector predictor; andperform, based on the decision, a conversion between the current blockand the bitstream representation.
 20. A non-transitory computer-readablerecording medium storing a bitstream representation which is generatedby a method performed by a video processing apparatus, wherein themethod comprises: making a decision for a current block regardingwhether a decoder side motion vector derivation (DMVD) tool for thecurrent block is enabled based on whether a coding mode is enabled forthe conversion; wherein the DMVD tool derives a refinement of motioninformation, and the coding mode comprises at least one of a merge modewith a motion vector difference that is indicated by a motion directionand a motion magnitude, or a motion vector prediction mode in which amotion vector is acquired based on a motion vector predictor; andperforming, based on the decision, the bitstream representation from thecurrent block.